SHELL = /bin/sh vpath %.o o CXXFLAGS = -O2 -static sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp0.cc cmdline.cc \ common.cc global.cc bin = dgp # plik *.o sa umieszczane w podkatalogu o objs = $(sources:%.cc=o/%.o) ${bin}: ${objs} ${CXX} ${CXXFLAGS} -o $@ ${objs} include $(sources:.cc=.d) o/%.o: %.cc ${CXX} -c ${CXXFLAGS} -o $@ $< %.d: %.cc $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,o/\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ cmdline.cc cmdline.h : cmdline.ggo gengetopt --c-extension=cc -i cmdline.ggo clean: rm ${bin} ${objs} cmdline.cc cmdline.h rm -rf *.d prof: dgp gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof