Makefile 643 B

123456789101112131415161718192021222324252627
  1. CXXFLAGS = -O2 -g
  2. CFLAGS = -O2 -g
  3. LIBS = -lboost_filesystem
  4. OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) \
  5. $(patsubst %.cc, %.o, $(wildcard *.cc))
  6. C_DEPS = $(patsubst %.c, %.dep, $(wildcard *.c))
  7. CXX_DEPS = $(patsubst %.cc, %.depxx, $(wildcard *.cc))
  8. tx01_data : $(OBJS)
  9. $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
  10. sinclude $(DEPS)
  11. %.dep : %.c
  12. $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
  13. sed 's,\($*\)\.o[ :]*,\1.o $@:.g' < $@.$$$$ > $@; \
  14. $(RM) $@.$$$$
  15. %.depxx : %.cc
  16. $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
  17. sed 's,\($*\)\.o[ :]*,\1.o $@:.g' < $@.$$$$ > $@; \
  18. $(RM) $@.$$$$
  19. .PHONY : clean
  20. clean:
  21. $(RM) tx01_data $(OBJS) $(C_DEPS) $(CXX_DEPS)