/
Makefile
260 lines (224 loc) · 6.27 KB
/
Makefile
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#!/usr/bin/make
#------------ Compiler choice ---------
CC="none"
ARCH="$(shell uname -m)"
OS="$(shell uname -s)"
ifeq ($(ARCH), "i386")
CC=gcc
endif
ifeq ($(ARCH), "i686")
CC=gcc
endif
ifeq ($(ARCH), "x86_64")
CC=gcc
ifeq ($(OS), "Darwin")
CC=gcc -Wno-parentheses-equality -Wno-unused-value -Wno-parentheses -Wno-empty-body
endif
endif
ifeq ($(ARCH), "armv7l")
CC=gcc
endif
ifeq ($(ARCH), "aarch64")
CC=gcc
endif
ifeq ($(CC), "none")
$(error Cannot determine C compiler to use)
endif
#------------ Debug value -------------
DEBUG=yes
#------------ Debian values -----------
DESTDIR=
VERSION=1.20
NODEPENDS=
PKGDIR=$(DESTDIR)/usr/share/algol68toc
DOCDIR=$(DESTDIR)/usr/share/doc/algol68toc
BINDIR=$(DESTDIR)/usr/bin
LIBDIR=$(DESTDIR)/usr/lib
INFODIR=$(DESTDIR)/usr/share/info
MANDIR=$(DESTDIR)/usr/share/man/man1
INCDIR=$(DESTDIR)/usr/include/algol68
APPDIR=$(DESTDIR)/usr/share/applications
#------------ macOS values -------------
ifeq ($(OS), "Darwin")
PKGDIR=$(DESTDIR)/usr/local/share/algol68toc
DOCDIR=$(DESTDIR)/usr/local/share/doc/algol68toc
BINDIR=$(DESTDIR)/usr/local/bin
LIBDIR=$(DESTDIR)/usr/local/lib
INFODIR=$(DESTDIR)/usr/local/share/info
MANDIR=$(DESTDIR)/usr/local/share/man/man1
INCDIR=$(DESTDIR)/usr/local/include/algol68
APPDIR=$(DESTDIR)/usr/local/share/applications
endif
#------------- Absolute directories ------------
TOP:=$(shell pwd)
VPATH:=$(TOP)/include
HERE:=$(shell basename `pwd`)
#------------- sub-directories --------------
ACD=$(TOP)/a68config
CTD=$(TOP)/src
DAD=$(TOP)/data
DOD=$(TOP)/doc
EXD=$(TOP)/examples
LBD=$(TOP)/library
LPD=$(TOP)/liba68prel
QAD=$(TOP)/qad
GCD=$(TOP)/bdwgc
ADIRS=a68config liba68prel src qad
CDIRS=library a68config liba68prel src
DDIRS=doc data examples scripts
INCS:=-I $(VPATH)
#------------- a68toc environment --------------
A68_GC_POLICY:=1
A68_GC_DEBUG:=0
A68_NAMESEED=nameseed
A68_LIB:=$(ACD)
#------------ Flags ------------
ifeq ($(DEBUG),no)
override CFLAGS=-O0
else
override CFLAGS=-O0 -g
endif
NOR=$(CFLAGS) $(INCS)
CTSTAR=59LR
QADSTAR=1234ABCD
CTFLAGS=-v -uname seedfile -staredit $(CTSTAR)
QADFLAGS=-v -s -uname seedfile -staredit $(QADSTAR)
#------------ Programs -----------
ALGOL=$(CTD)/a68toc
SHELL=/bin/sh
INSTALL=$(shell which install) -g root -o root
ifeq ($(OS), "Darwin")
INSTALL=$(shell which install) -g wheel -o root
endif
INSTALLDATA=$(INSTALL) -m 644
INSTALLPROG=$(INSTALL) -m 555
# Export all macros
export
#-------------- Rules --------------
.PHONY : clean info uninstall
#-----Don't remake the documentation all the time----
#all : g-stamp c-stamp q-stamp d-stamp
all : g-stamp c-stamp q-stamp
remove :
for d in $(ADIRS); do $(RM) $$d/*.c $$d/*.m; done
Translate : remove nameseed
-for d in $(ADIRS); do $(MAKE) -C $$d Translate; done
g-stamp: $(GCD)/gc.a
-mkdir -p include/gc
cp -r $(GCD)/include/* include/algol68/gc
cp $(GCD)/gc.a library/liba68gc.a
touch g-stamp
$(GCD)/gc.a:
tar zxvf bdwgc.tar.gz
-$(MAKE) -C $(GCD) -f Makefile.direct check
c-stamp: g-stamp
-for d in $(CDIRS); do $(MAKE) -C $$d; done
touch c-stamp
q-stamp : nameseed
-$(MAKE) -C $(QAD)
touch q-stamp
d-stamp :
-$(MAKE) -C $(DOD)
touch d-stamp
#install : c-stamp q-stamp d-stamp
install : g-stamp c-stamp q-stamp
$(INSTALL) -m 755 -d $(PKGDIR)
$(INSTALL) -m 755 -d $(INCDIR)
$(INSTALL) -m 755 -d $(INCDIR)/linux
$(INSTALL) -m 755 -d $(INCDIR)/gc
$(INSTALL) -m 755 -d $(INCDIR)/gc/extra
$(INSTALL) -m 755 -d $(INCDIR)/gc/private
$(INSTALL) -m 755 -d $(BINDIR)
$(INSTALL) -m 755 -d $(LIBDIR)
$(INSTALL) -m 755 -d $(INFODIR)
$(INSTALL) -m 755 -d $(DOCDIR)
$(INSTALL) -m 755 -d $(DOCDIR)/examples
$(INSTALL) -m 755 -d $(DOCDIR)/examples/logic
$(INSTALL) -m 755 -d $(DOCDIR)/examples/tests
$(INSTALL) -m 755 -d $(DOCDIR)/pame
$(INSTALL) -m 755 -d $(APPDIR)
$(INSTALL) -m 755 -d $(MANDIR)
$(INSTALLDATA) -p README $(DOCDIR)
for d in include library $(ADIRS) $(DDIRS); do $(MAKE) -C $$d install; done
info :
install-info --quiet $(INFODIR)/ctrans.info.gz $(INFODIR)/dir
uninstall :
-$(RM) $(BINDIR)/a68toc $(BINDIR)/resetseed $(BINDIR)/ca
-install-info --quiet --remove $(INFODIR)/ctrans.info.gz $(INFODIR)/dir
-$(RM) -rf $(PKGDIR) $(DOCDIR) $(INCDIR)
-$(RM) $(INFODIR)/ctrans.info.gz $(LIBDIR)/liba68.a $(LIBDIR)/liba68s.a $(LIBDIR)/liba68gc.a \
$(MANDIR)/a68toc.1.gz $(MANDIR)/ca.1.gz
dist-clean: clean
-$(RM) -v c-stamp q-stamp d-stamp g-stamp
-$(RM) -r debian/tmp debian/algol68toc
-$(RM) -rf bdwgc
nameseed : a68config/rctr liba68prel/rctr src/rctr qad/rctr
for d in $(ADIRS); do cp $$d/rctr $$d/nameseed; done
savepoint:
COPYFILE_DISABLE=1 tar zcvf ../$(HERE).save.a68.tar.gz .
restore:
tar zxvf ../$(HERE).save.tar.gz
clean:
find $(TOP) \( -name '*~' -o -name '*.asv' -o -name '*##' \) \
-exec $(RM) -v '{}' ';'
-for d in $(ADIRS) $(DDIRS) library; do $(MAKE) -C $$d clean; done
-$(MAKE) -C $(GCD) -f Makefile.direct clean
realclean:
find $(TOP) \( -name '*~' -o -name '*.asv' -o -name '*##' \) \
-exec $(RM) -v '{}' ';'
-for d in $(ADIRS) $(DDIRS) library; do $(MAKE) -C $$d realclean; done
vars:
echo "NOR is $(NOR)"
# $Log: Makefile,v $
# Revision 1.12 2012/01/04 17:18:45 sian
# *** empty log message ***
#
# Revision 1.11 2004-08-06 23:48:41 sian
# *** empty log message ***
#
# Revision 1.10 2003/05/31 13:02:41 sian
# Removal of compiled libraries and binaries
#
# Revision 1.9 2003/04/23 08:57:20 sian
# Debian release 1.5
#
# Revision 1.8 2002/06/20 13:16:57 sian
# Minor alterations to make files
#
# Revision 1.7 2002/06/20 11:49:27 sian
# mm removed, padding removed, ca68 added
#
# Revision 1.6 2002/06/06 12:46:19 sian
# Minor alterations
#
# Revision 1.5 2002/02/23 17:50:42 sian
# Release 1.1
#
# Revision 1.4 2002/02/19 11:40:11 sian
# *** empty log message ***
#
# Revision 1.2 2001/05/11 18:55:32 sian
# Changed INFODIR to /usr/share/info
#
# Revision 1.1.1.1 2001/05/07 10:16:10 sian
# Import of Ctrans v1.0.4
#
# Revision 1.9 2000/07/06 14:46:57 sian
# Added uninstall
#
# Revision 1.8 2000/07/06 13:08:21 sian
# Should be ready for release
#
# Revision 1.7 2000/07/05 19:20:35 sian
# Minor corrections to Makefiles
#
# Revision 1.6 2000/07/05 15:52:57 sian
# Altered the installation tarball to ctrans-bin_$(VERSION).tar.gz
#
# Revision 1.5 2000/07/05 14:37:53 sian
# Ready for release 0.1.0
#
# Revision 1.3 2000/01/19 17:51:20 sian
# New versions for Phoenix Engineering release of Ctrans
#
# End of Makefile