source:
src/dgp/Makefile
@
c03f8a5
Last change on this file since c03f8a5 was d484a32, checked in by Tomasz Obrebski <obrebski@…>, 10 years ago | |
---|---|
|
|
File size: 1.2 KB |
Rev | Line | |
---|---|---|
[e7de6cc] | 1 | |
[5f4d9c3] | 2 | include ../../config.mak |
3 | ||
[e7de6cc] | 4 | |
[5f4d9c3] | 5 | SHELL = /bin/sh |
6 | LIB_PATH=../../lib | |
7 | COMMON_PATH=../common | |
8 | CMDLINE_FILE='"../dgp/cmdline.h"' | |
9 | ||
10 | ||
[e7de6cc] | 11 | #vpath %.o . |
[5f4d9c3] | 12 | |
[d484a32] | 13 | CXXFLAGS = -g -Wno-deprecated -static |
[5f4d9c3] | 14 | |
[e7de6cc] | 15 | sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp1.cc cmdline.cc \ |
[5f4d9c3] | 16 | $(COMMON_PATH)/common.cc global.cc |
17 | ||
18 | bin = dgp | |
19 | ||
20 | # plik *.o sa umieszczane w podkatalogu o | |
21 | objs = $(sources:%.cc=%.o) | |
22 | ||
23 | ${bin}: ${objs} | |
[e7de6cc] | 24 | ${CXX} ${CXXFLAGS} -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs} |
[5f4d9c3] | 25 | |
26 | include $(sources:.cc=.d) | |
27 | ||
28 | %.o: %.cc | |
[e7de6cc] | 29 | ${CXX} -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $< |
[5f4d9c3] | 30 | |
31 | %.d: %.cc | |
32 | $(CC) -MM $(CPPFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) $< > $@.$$$$; \ | |
33 | sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ | |
34 | rm -f $@.$$$$ | |
35 | ||
[e7de6cc] | 36 | |
[5f4d9c3] | 37 | cmdline.cc cmdline.h: cmdline.ggo |
[e7de6cc] | 38 | gengetopt -i cmdline.ggo --c-extension=cc --conf-parser |
[5f4d9c3] | 39 | |
40 | cmdline.ggo: cmdline_dgp.ggo ../common/cmdline_common.ggo | |
41 | cat cmdline_dgp.ggo ../common/cmdline_common.ggo > cmdline.ggo | |
42 | ||
43 | ||
[e7de6cc] | 44 | |
45 | .PHONY: clean | |
[5f4d9c3] | 46 | clean: |
[e7de6cc] | 47 | rm -f ${bin} ${objs} cmdline.* |
48 | rm -f *.d | |
[d484a32] | 49 | rm -f *~ |
[5f4d9c3] | 50 | |
[e7de6cc] | 51 | .PHONY: prof |
[5f4d9c3] | 52 | prof: dgp |
53 | gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof | |
54 | ||
[e7de6cc] | 55 | |
[5f4d9c3] | 56 | .PHONY: install |
57 | install: | |
58 | ifdef BIN_DIR | |
59 | install -m 0755 dgp $(BIN_DIR) | |
60 | endif | |
61 | ||
62 | .PHONY: uninstall | |
63 | uninstall: | |
64 | ifdef BIN_DIR | |
65 | rm $(BIN_DIR)/dgp | |
66 | endif |
Note: See TracBrowser
for help on using the repository browser.