Makefile 776 B

1234567891011121314151617181920212223242526272829303132333435
  1. CXXFLAGS = -O2 -g
  2. CFLAGS = -O2 -g
  3. OS := $(shell uname -s)
  4. IS_MINGW := $(shell echo $(OS) | grep -i MINGW)
  5. ifdef IS_MINGW
  6. LIBS = -lboost_filesystem-mt.dll
  7. else
  8. LIBS = -lboost_filesystem
  9. endif
  10. OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) \
  11. $(patsubst %.cc, %.o, $(wildcard *.cc))
  12. C_DEPS = $(patsubst %.c, %.dep, $(wildcard *.c))
  13. CXX_DEPS = $(patsubst %.cc, %.depxx, $(wildcard *.cc))
  14. tx01_data : $(OBJS)
  15. $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
  16. sinclude $(DEPS)
  17. %.dep : %.c
  18. $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
  19. sed 's,\($*\)\.o[ :]*,\1.o $@:.g' < $@.$$$$ > $@; \
  20. $(RM) $@.$$$$
  21. %.depxx : %.cc
  22. $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
  23. sed 's,\($*\)\.o[ :]*,\1.o $@:.g' < $@.$$$$ > $@; \
  24. $(RM) $@.$$$$
  25. .PHONY : clean
  26. clean:
  27. $(RM) tx01_data $(OBJS) $(C_DEPS) $(CXX_DEPS)