SHELL = /bin/sh LIB_PATH=../../lib COMMON_PATH=../common CMDLINE_FILE='"../dgp/cmdline.h"' #vpath %.o . CXXFLAGS = -O2 -static sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp0.cc cmdline.cc \ $(COMMON_PATH)/common.cc global.cc bin = dgp # plik *.o sa umieszczane w podkatalogu o objs = $(sources:%.cc=%.o) ${bin}: ${objs} ${CXX} ${CXXFLAGS} -o $@ ${objs} include $(sources:.cc=.d) %.o: %.cc ${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $< %.d: %.cc $(CC) -MM $(CPPFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ # stare: # cmdline.cc cmdline.h : cmdline.ggo # gengetopt --c-extension=cc -i cmdline.ggo # nowe cmdline.cc cmdline.h: cmdline.ggo gengetopt -i cmdline.ggo --c-extension=cc --conf-parser cmdline.ggo: cmdline_dgp.ggo ../common/cmdline_common.ggo cat cmdline_dgp.ggo ../common/cmdline_common.ggo > cmdline.ggo # endnowe clean: rm ${bin} ${objs} cmdline.cc cmdline.h rm -rf *.d prof: dgp gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof copy: ifdef UTT_BIN_DIR cp dgp dgc canonize tre.rb $(UTT_BIN_DIR)/ # ponizsza linijka jest do usuniecia cp go attr.pm seg.rb $(UTT_BIN_DIR)/ endif