Merge remote branch 'master'
[prop.git] / Makefile
bloba78747d3ff4e2c4a114e1ddff732c18b91c098d3
1 #############################################################################
3 # Top level makefile for installing Prop and ADLib
5 #############################################################################
7 VERSION = 2.3.0
9 RM = rm -f
10 LIBRARY = libprop.a
11 CC = g++-3.3
12 COPTS = -O6 -pedantic -frepo -g
13 PROP_COPTS = $(COPTS)
14 #LIBRARY_COPTS = -O6 -pedantic -Wall -fexternal-templates
15 LIBRARY_COPTS = -O6 -pedantic -Wall -g
16 LDOPTS = #-lg++
17 OBJ = obj
19 TARGET_BIN_DIR = /usr/local/bin
20 TARGET_LIB_DIR = /usr/local/lib
21 TARGET_INCLUDE_DIR = /usr/local/include
24 # You may have to add this for g++ 2.6.x
26 #COPTS = -g -O6 -fno-implicit-templates
28 ##############################################################################
29 # Files in the ADLib package:
30 ##############################################################################
31 MiscFiles= INSTALL README NOTICE COPYRIGHT \
32 Makefile lib-src/Makefile
33 Areas = algebra automata contain csp dynparser gc generic \
34 generic hash memory numeric object objc \
35 prop rete rewrite persist prettypr \
36 sort strings symbolic trees tries \
37 scheduling absinterp machine dataflow parser-tools \
38 backend_tools
39 TarFile= prop-$(VERSION).tar.gz
41 #############################################################################
43 # Build the ADLib library and the tools
45 #############################################################################
46 build:
47 cd lib-src; make CC="$(CC)" COPTS="$(LIBRARY_COPTS)" LDOPTS="$(LDOPTS)" OBJ="$(OBJ)"
48 cd prop-src; make CC="$(CC)" COPTS="$(PROP_COPTS)" LDOPTS="$(LDOPTS)" OBJ="$(OBJ)"
49 cd docs; make
50 @echo Done
52 config:
53 ./Configure $(CC)
55 #############################################################################
57 # Test prop
59 #############################################################################
60 test:
61 cd prop-src; make test CC="$(CC)" COPTS="$(COPTS)" LDOPTS="$(LDOPTS)" OBJ="$(OBJ)"
62 @echo Testing of the prop translator ran ok.
64 testall:
65 cd tests; make test CC="$(CC)" COPTS="$(COPTS)" LDOPTS="$(LDOPTS)" OBJ="$(OBJ)"
66 @echo All test programs ran ok.
68 demo:
69 cd demos; make CC="$(CC)" COPTS="$(COPTS)" LDOPTS="$(LDOPTS)" OBJ="$(OBJ)"
70 @echo All demo programs have been compiled.
72 #############################################################################
74 # Line count
76 #############################################################################
77 wc:
78 wc include/AD/*/*.h lib-src/*/*.cc \
79 prop-src/[a-z]*.ph \
80 prop-src/[a-z]*.pcc
82 #############################################################################
84 # Clean up: remove all *.o files and .cc and .h files generated using
85 # Prop. But don't remove the executable and the library.
87 #############################################################################
88 spotless:
89 cd lib-src; make spotless
90 cd prop-src; make spotless
91 cd tools/test; make spotless
92 cd tests; make spotless
93 cd demos; make spotless
94 cd tools/pretty; make spotless
95 #cd docs; make spotless
97 cleanhouse:
98 cd lib-src; make spotless
99 cd prop-src; make clean
100 cd tools/test; make spotless
101 cd tests; make spotless
102 cd demos; make spotless
103 cd tools/pretty; make spotless
104 cd docs; make spotless
105 $(RM) lib-src/$(LIBRARY) prop-src/prop
107 #############################################################################
108 # Make tar.gz files for Unix distribution.
109 #############################################################################
110 dist: tar
111 tar:
112 bin/Distribute NO_DISTRIBUTE
113 full-dist:
114 bin/Distribute NO_DISTRIBUTE2
116 first-install:
117 cp prop-src/prop $(TARGET_BIN_DIR)
118 chmod 755 $(TARGET_BIN_DIR)/prop
119 cp tools/scripts/* $(TARGET_BIN_DIR)
120 cp lib-src/$(LIBRARY) $(TARGET_LIB_DIR)
121 chmod 644 $(TARGET_LIB_DIR)/$(LIBRARY)
122 cp include/propdefs.h $(TARGET_INCLUDE_DIR)
124 install: first-install
125 ln -f -s `pwd`/include/AD $(TARGET_INCLUDE_DIR)/AD
127 full-install: first-install
128 (umask 022; cp -R include $(TARGET_INCLUDE_DIR))