Makefile 981 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Example Makefile script
  2. # Purpose: Demonstrate usage of pkg-config with the nanoflann library
  3. # By: Jose Luis Blanco, 2011
  4. #
  5. # ========================= *IMPORTANT* ================================
  6. # For this method to work nanoflann must be installed in your
  7. # system in a path accesible to pkg-config. To check if pkg-config
  8. # sees nanoflann config files, execute:
  9. # pkg-config --list-all | grep nanoflann
  10. # ======================================================================
  11. #
  12. # Set up basic variables:
  13. CC = g++
  14. CFLAGS = -c -Wall -O2 -mtune=native
  15. LDFLAGS =
  16. # List of sources:
  17. SOURCES = pointcloud_example.cpp
  18. OBJECTS = $(SOURCES:.cpp=.o)
  19. # Name of executable target:
  20. EXECUTABLE = pointcloud_example
  21. # nanoflann flags:
  22. CFLAGS += `pkg-config --cflags nanoflann`
  23. all: $(SOURCES) $(EXECUTABLE)
  24. $(EXECUTABLE): $(OBJECTS)
  25. $(CC) $(LDFLAGS) $(OBJECTS) -o $@
  26. .cpp.o:
  27. $(CC) $(CFLAGS) $< -o $@
  28. clean:
  29. rm $(OBJECTS) $(EXECUTABLE)