include ../../config.mak SHELL = /bin/sh LIB_PATH=../../lib COMMON_PATH=../common CMDLINE_FILE='"../dgp/cmdline.h"' #vpath %.o . CXXFLAGS = -g -static sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp1.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} -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs} include $(sources:.cc=.d) %.o: %.cc ${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $< %.d: %.cc $(CC) -MM $(CPPFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ rm -f $@.$$$$ 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 .PHONY: clean clean: rm -f ${bin} ${objs} cmdline.* rm -f *.d .PHONY: prof prof: dgp gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof .PHONY: install install: ifdef BIN_DIR install -m 0755 dgp $(BIN_DIR) endif .PHONY: uninstall uninstall: ifdef BIN_DIR rm $(BIN_DIR)/dgp endif