source: src/dgp/Makefile @ cfdf333

Last change on this file since cfdf333 was 5f4d9c3, checked in by Maciej Prill <mprill@…>, 13 years ago

Rewritten the build system, added lem UTF-8 version.

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[5f4d9c3]1include ../../config.mak
2
3SHELL = /bin/sh
4LIB_PATH=../../lib
5COMMON_PATH=../common
6CMDLINE_FILE='"../dgp/cmdline.h"'
7
8#vpath %.o  .
9
10ifeq ($(BUILD_STATIC), yes)
11        LDFLAGS += -static
12endif
13
14CXXFLAGS += -O2
15
16sources = main.cc grammar.cc symbol.cc mgraph.cc sgraph.cc dgp0.cc cmdline.cc \
17          $(COMMON_PATH)/common.cc global.cc
18
19bin  = dgp
20
21# plik *.o sa umieszczane w podkatalogu o
22objs = $(sources:%.cc=%.o)
23
24${bin}: ${objs}
25        $(CXX) $(CXXFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) -o $@ ${objs} $(LDFLAGS)
26
27include $(sources:.cc=.d)
28
29%.o: %.cc
30        $(CXX) -D _CMDLINE_FILE=$(CMDLINE_FILE) -c ${CXXFLAGS} -o $@ $<
31
32%.d: %.cc
33        $(CC) -MM $(CPPFLAGS) -D _CMDLINE_FILE=$(CMDLINE_FILE) $< > $@.$$$$; \
34        sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
35        rm -f $@.$$$$
36
37# stare:
38# cmdline.cc cmdline.h : cmdline.ggo
39#       gengetopt --c-extension=cc -i cmdline.ggo
40# nowe
41cmdline.cc cmdline.h: cmdline.ggo
42        $(GENGETOPT) -i cmdline.ggo  --c-extension=cc --conf-parser
43
44cmdline.ggo: cmdline_dgp.ggo ../common/cmdline_common.ggo
45        cat cmdline_dgp.ggo ../common/cmdline_common.ggo > cmdline.ggo
46# endnowe
47
48
49clean:
50        rm ${bin} ${objs} cmdline.cc cmdline.h
51        rm -rf *.d
52
53prof: dgp
54        gprof dgp ~/tmp/dgp-pl/gmon.out > dgp.prof
55
56.PHONY: install
57install:
58ifdef BIN_DIR
59        install -m 0755 dgp $(BIN_DIR)
60        install -m 0755 dgc $(BIN_DIR)
61        install -m 0755 canonize $(BIN_DIR)
62        install -m 0755 tre $(BIN_DIR)
63endif
64
65.PHONY: uninstall
66uninstall:
67ifdef BIN_DIR
68        rm $(BIN_DIR)/dgp
69        rm $(BIN_DIR)/dgc
70        rm $(BIN_DIR)/canonize
71        rm $(BIN_DIR)/tre
72endif
Note: See TracBrowser for help on using the repository browser.