initial
[prop.git] / Makefile
blob964e7c4baa400c5d241c823ef0770d9c2aa4cdc1
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++
12 COPTS = -O6 -pedantic -frepo
13 PROP_COPTS = $(COPTS)
14 #LIBRARY_COPTS = -O6 -pedantic -Wall -fexternal-templates
15 LIBRARY_COPTS = -O6 -pedantic -Wall
16 LDOPTS = #-lg++
18 TARGET_BIN_DIR = /usr/local/bin
19 TARGET_LIB_DIR = /usr/local/lib
20 TARGET_INCLUDE_DIR = /usr/local/include
23 # You may have to add this for g++ 2.6.x
25 #COPTS = -g -O6 -fno-implicit-templates
27 ##############################################################################
28 # Files in the ADLib package:
29 ##############################################################################
30 MiscFiles= INSTALL README NOTICE COPYRIGHT \
31 Makefile lib-src/Makefile
32 Areas = algebra automata contain csp dynparser gc generic \
33 generic hash memory numeric object objc \
34 prop rete rewrite persist prettypr \
35 sort strings symbolic trees tries \
36 scheduling absinterp machine dataflow parser-tools \
37 backend_tools
38 TarFile= prop-$(VERSION).tar.gz
40 #############################################################################
42 # Build the ADLib library and the tools
44 #############################################################################
45 build:
46 cd lib-src; make CC="$(CC)" COPTS="$(LIBRARY_COPTS)" LDOPTS="$(LDOPTS)"
47 cd prop-src; make CC="$(CC)" COPTS="$(PROP_COPTS)" LDOPTS="$(LDOPTS)"
48 cd docs; make
49 @echo Done
51 config:
52 ./Configure $(CC)
54 #############################################################################
56 # Test prop
58 #############################################################################
59 test:
60 cd prop-src; make test CC="$(CC)" COPTS="$(COPTS)" LDOPTS="$(LDOPTS)"
61 @echo Testing of the prop translator ran ok.
63 testall:
64 cd tests; make test CC="$(CC)" COPTS="$(COPTS)" LDOPTS="$(LDOPTS)"
65 @echo All test programs ran ok.
67 demo:
68 cd demos; make CC="$(CC)" COPTS="$(COPTS)" LDOPTS="$(LDOPTS)"
69 @echo All demo programs have been compiled.
71 #############################################################################
73 # Line count
75 #############################################################################
76 wc:
77 wc include/AD/*/*.h lib-src/*/*.cc \
78 prop-src/[a-z]*.ph \
79 prop-src/[a-z]*.pcc
81 #############################################################################
83 # Clean up: remove all *.o files and .cc and .h files generated using
84 # Prop. But don't remove the executable and the library.
86 #############################################################################
87 spotless:
88 cd lib-src; make spotless
89 cd prop-src; make spotless
90 cd tools/test; make spotless
91 cd tests; make spotless
92 cd demos; make spotless
93 cd tools/pretty; make spotless
94 #cd docs; make spotless
96 cleanhouse:
97 cd lib-src; make spotless
98 cd prop-src; make clean
99 cd tools/test; make spotless
100 cd tests; make spotless
101 cd demos; make spotless
102 cd tools/pretty; make spotless
103 cd docs; make spotless
104 $(RM) lib-src/$(LIBRARY) prop-src/prop
106 #############################################################################
107 # Make tar.gz files for Unix distribution.
108 #############################################################################
109 dist: tar
110 tar:
111 bin/Distribute NO_DISTRIBUTE
112 full-dist:
113 bin/Distribute NO_DISTRIBUTE2
115 first-install:
116 cp prop-src/prop $(TARGET_BIN_DIR)
117 chmod 755 $(TARGET_BIN_DIR)/prop
118 cp tools/scripts/* $(TARGET_BIN_DIR)
119 cp lib-src/$(LIBRARY) $(TARGET_LIB_DIR)
120 chmod 644 $(TARGET_LIB_DIR)/$(LIBRARY)
121 cp include/propdefs.h $(TARGET_INCLUDE_DIR)
123 install: first-install
124 ln -f -s `pwd`/include/AD $(TARGET_INCLUDE_DIR)/AD
126 full-install: first-install
127 (umask 022; cp -R include $(TARGET_INCLUDE_DIR))