summaryrefslogtreecommitdiff
path: root/dil2al/Makefile
blob: 3e1b82d51f0300a9f09ad38b64b3bef00e8bdff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#
# Makefile for dil2al
# (by Randal A. Koene, randalk@minduploading.org)
#
# Instructions to insure a successful make:
# 1. Insure that LIB_PATH points to the directory in which
#    -X11 and -Xext libraries can be found
# 2. Edit the include paths (e.g. -I/usr/openwin/include) in
#    CPPFLAGS to refelect the correct location of g++, -X11
#    and -Xext include files
# 3. Make sure the dynamic shared libraries can be located by
#    ld.so.1 at runtime (e.g. define an environment variable
#    setenv LD_LIBRARY_PATH "/usr/openwin/lib")

##########################################################
## Compiler
## --------
CC=gcc
CCPP=g++ 
##########################################################

INCLUDES= -I$(HOME)/src/include

##########################################################
## Machine selection
## -----------------
## aurora (x86):
MACHSPEC=
MACHSTR=
GCCTUNE=$(if $(shell gcc -v 2>&1 | grep "^gcc version[^0-9]*[4-9][.]"),-mtune=native)
#MACHOPT=
MACHOPT=-march=native $(GCCTUNE) -mfpmath=sse
##
## kenji (SUN Ultra):
#MACHSPEC= -DSUN_RX
#MACHSTR=SUN
##
##########################################################

### Attempting a temporary fix for gcc 4.x compilation of dil2al
### (This should be replaced by actual source code modification.)
CPPTEMPWORKAROUND=-fno-access-control
RXSPECIAL=-Wno-error

##########################################################
## Regular Expression Library
## --------------------------
## (Suggestion: Using regex-gnu.h guarantees the greatest
## amount of compatibility and identical behaviour on all
## platforms, since it is included with the dil2al source
## code and has been adapted for reliable use with C++.)
##
## regex-gnu.h adapted for integration with C++:
GCC3FXTRA=$(if $(shell gcc -v 2>&1 | grep "^gcc version[^0-9]*[3-9][.]"),-Wno-unused-function)
ALT_REGEX=regex-gnu.o
ALT_REGEX_H=\"regex-gnu.h\"
CFXTRA= -D__DIL2AL__ -DSTDC_HEADERS -pedantic -Wall -Wno-char-subscripts $(GCC3FXTRA)
CPPXTRA= -D__DIL2AL__ -D_ALT_REGEX_H=$(ALT_REGEX_H) $(MACHOPT) -mieee-fp -ffast-math -D_USE_ALT_REGEX -D_CPP_REGEX -DDEFAULTHOMEDIR=\"$(HOME)\" -pedantic -Wall $(GCC3FXTRA) $(CPPTEMPWORKAROUND)
REGEXSTR=regex-gnu_for_C++
##
## rx.h:
#ALT_REGEX=rx.o
#ALT_REGEX_H=
#CFXTRA= -D__DIL2AL__
#CPPXTRA= -D__DIL2AL__ -D_BIGREGEX_HAS_RM_SPEP
#REGEXSTR=rx
##
## generic GNU regex (Linux/GNU specific):
#ALT_REGEX=regex.o
#ALT_REGEX_H=regex.h
#CFXTRA=
#CPPXTRA= -D_ALT_REGEX_H=$(ALT_REGEX_H) -D_USE_ALT_REGEX -D__DIL2AL__ -D_BIGREGEX_HAS_RM_SPEP
#REGEXSTR=regex
##
## system <regex.h> (SUN specific):
#ALT_REGEX=
#ALT_REGEX_H=
#CFXTRA= -DSYSTEM_RX
#CPPXTRA= -D__DIL2AL__ -DSYSTEM_RX
#REGEXSTR=system
##########################################################

##########################################################
## Safe Regular Expressions
## ------------------------
## assume '\0' within String length and rm structure has
## no sp/ep pointers:
#SAFEREGEX=
## make no assumptions:
SAFEREGEX= -D_BIGREGEX_SAFE_MATCHES
##########################################################

##########################################################
## Compiler Options
## ----------------
## debugging information:
#COMPOPT= -g
#OPTSTR=debugging_info
## generate profile information for use with gprof:
#COMPOPT= -g -O6
#OPTSTR=profiling
## optimized:
COMPOPT= -O3
OPTSTR=optimized
##########################################################

##########################################################
## C++ Specific Compiler Options
## -----------------------------
## debugging information:
#CPPOPT=
## generate profile information for use with gprof:
#CPPOPT=
## optimized:
CPPOPT= -felide-constructors
## uncomment the following optimization option only if
## you have an older C++ compiler that does not optimize
## return values unless explicitly told to do so with
## the now deprecated `named return value' extension:
#CPPOPT= $(CPPOPT) -D_USE_NAMED_RETURN_VALUE_EXTENSION
##########################################################

CFLAGS= $(COMPOPT) $(MACHSPEC) $(CFXTRA)
CPPFLAGS= $(COMPOPT) $(CPPOPT) $(MACHSPEC) $(CPPXTRA) $(SAFEREGEX) $(INCLUDES)

.INIT:
	@echo '-------------------------------------------------------------------'
	@echo 'Compilation options: $(MACHSTR), $(OPTSTR), $(REGEXSTR)'
	@echo '-------------------------------------------------------------------'

all: dil2al

dil2al.o: dil2al.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c dil2al.cc -o dil2al.o

alcomp.o: alcomp.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c alcomp.cc -o alcomp.o

diladmin.o: diladmin.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c diladmin.cc -o diladmin.o

utilities.o: utilities.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c utilities.cc -o utilities.o

tladmin.o: tladmin.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c tladmin.cc -o tladmin.o

note.o: note.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c note.cc -o note.o

controller.o: controller.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c controller.cc -o controller.o

tlfilter.o: tlfilter.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c tlfilter.cc -o tlfilter.o

ppfilter.o: ppfilter.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c ppfilter.cc -o ppfilter.o

search.o: search.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c search.cc -o search.o

finances.o: finances.cc dil2al.hh BigString.hh BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c finances.cc -o finances.o

cksum.o: cksum.cc cksum.hh BigString.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c cksum.cc -o cksum.o

BigString.o: BigString.cc BigString.hh
	$(CCPP) $(CPPFLAGS) $(COLORS) -c BigString.cc -o BigString.o

BigRegex.o: BigRegex.cc BigRegex.hh rx.h regex.h regex-gnu.h
	$(CCPP) $(CPPFLAGS) $(COLORS) -c BigRegex.cc -o BigRegex.o

regex.o: regex.c regex.h
	$(CC) $(CFLAGS) -c regex.c -o regex.o

regex-gnu.o: regex-gnu.c regex-gnu.h
	$(CCPP) $(CFLAGS) -c regex-gnu.c -o regex-gnu.o

rx.o: rx.c rx.h
	$(CC) $(CFLAGS) $(COLORS) $(RXSPECIAL) -c rx.c -o rx.o

dil2al: dil2al.o alcomp.o diladmin.o utilities.o tladmin.o note.o controller.o tlfilter.o ppfilter.o search.o finances.o cksum.o BigString.o BigRegex.o regex-gnu.o regex.o rx.o
	$(CCPP) $(CPPFLAGS) dil2al.o alcomp.o diladmin.o utilities.o tladmin.o note.o controller.o tlfilter.o ppfilter.o search.o finances.o cksum.o $(ALT_REGEX) BigString.o BigRegex.o -o dil2al $(LIB_PATH)

clean:
	rm -r -f *.o $(NAME)

doc++:
	rm -r -f html
	doc++ -d html spiker.dxx