Makefile 805 B

1234567891011121314151617181920212223242526272829303132
  1. CC = g++
  2. DEBUG = -g
  3. CFLAGS = -Iinclude -I../op_utility/include -I../op_planner/include -Wall $(DEBUG)
  4. LFLAGS = -Llibs -L../op_planner/libs -L../op_utility/libs -lGL -lGLU -lglut -lpthread -lutility -lplanner -lopencv_core -lopencv_video -lopencv_highgui -Wl,-rpath=.:../op_utility/libs -Wl,-rpath=.:../op_planner/libs
  5. SRC = $(wildcard src/*.cpp)
  6. INCLUDES = $(wildcard include/*.h)
  7. OBJ = $(SRC:.cpp=.o)
  8. EXE = libs/Simu
  9. LIB = libs/libsimu.so
  10. all: $(LIB) $(EXE)
  11. pre-build:
  12. -@echo 'Post build commands'
  13. $(EXE): main.o $(OBJ)
  14. $(CC) -o $@ $< src/*.o $(LFLAGS)
  15. $(LIB): $(OBJ)
  16. $(CC) -o $(LIB) src/*.o $(LFLAGS) -shared
  17. main.o: main.cpp
  18. $(CC) -o $@ $< $(CFLAGS) -c -fPIC
  19. src/%.o: src/%.cpp
  20. $(CC) -o $@ -c $< $(CFLAGS) -fPIC
  21. .PHONY: clean
  22. clean:
  23. rm -rf src/*.o *.o libs/Simu libs/libsimu.so