1234567891011121314151617181920212223242526272829303132333435 |
- CXXFLAGS = -O2 -g
- CFLAGS = -O2 -g
- OS := $(shell uname -s)
- IS_MINGW := $(shell echo $(OS) | grep -i MINGW)
- ifdef IS_MINGW
- LIBS = -lboost_filesystem-mt.dll
- else
- LIBS = -lboost_filesystem
- endif
- OBJS = $(patsubst %.c, %.o, $(wildcard *.c)) \
- $(patsubst %.cc, %.o, $(wildcard *.cc))
- C_DEPS = $(patsubst %.c, %.dep, $(wildcard *.c))
- CXX_DEPS = $(patsubst %.cc, %.depxx, $(wildcard *.cc))
- tx01_data : $(OBJS)
- $(CXX) $(LDFLAGS) -o $@ $^ $(LIBS)
- sinclude $(DEPS)
- %.dep : %.c
- $(CC) -MM $(CFLAGS) $< > $@.$$$$; \
- sed 's,\($*\)\.o[ :]*,\1.o $@:.g' < $@.$$$$ > $@; \
- $(RM) $@.$$$$
- %.depxx : %.cc
- $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
- sed 's,\($*\)\.o[ :]*,\1.o $@:.g' < $@.$$$$ > $@; \
- $(RM) $@.$$$$
- .PHONY : clean
- clean:
- $(RM) tx01_data $(OBJS) $(C_DEPS) $(CXX_DEPS)
|