File: Makefile_macosx

package info (click to toggle)
ats-lang-anairiats 0.2.11-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 20,208 kB
  • sloc: ansic: 209,677; makefile: 2,261; sh: 661
file content (369 lines) | stat: -rw-r--r-- 9,250 bytes parent folder | download | duplicates (2)
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
#########################################################################
##                                                                     ##
##                         Applied Type System                         ##
##                                                                     ##
##                              Hongwei Xi                             ##
##                                                                     ##
#########################################################################

##
## ATS/Anairiats - Unleashing the Potential of Types!
##
## Copyright (C) 2002-2010 Hongwei Xi.
##
## ATS is  free software;  you can redistribute it and/or modify it under
## the  terms of the  GNU General Public License as published by the Free
## Software Foundation; either version 2.1, or (at your option) any later
## version.
##
## ATS is distributed in the hope that it will be useful, but WITHOUT ANY
## WARRANTY; without  even  the  implied  warranty  of MERCHANTABILITY or
## FITNESS FOR A PARTICULAR PURPOSE.  See the  GNU General Public License
## for more details.
##
## You  should  have  received  a  copy of the GNU General Public License
## along  with  ATS;  see  the  file  COPYING.  If not, write to the Free
## Software Foundation, 51  Franklin  Street,  Fifth  Floor,  Boston,  MA
## 02110-1301, USA.
##

######

##
## Author: Hongwei Xi (hwxi AT cs DOT bu DOT edu)
## Author: Likai Liu (liulk AT cs DOT bu DOT edu)
## Author: Yuri D'Elia (wavexx AT thregr DOT org)
##

# Disable parallelism and implicit rules
MAKEFLAGS += -j1
.SUFFIXES:

all:: Makefile

######

# integration with autoconf.

SRC_CONFIG_FILES := config.mk.in config.h.in
BUILT_CONFIG_FILES := $(SRC_CONFIG_FILES:%.in=%)

Makefile: config.mk

config.status: configure
	./configure
	touch $@

$(BUILT_CONFIG_FILES): %: config.status $(filter-out %,$(SRC_CONFIG_FILES))
	./config.status
	touch $(BUILT_CONFIG_FILES)

config.h.in: configure.ac
	autoheader $<
	touch $@

configure: configure.ac $(SRC_CONFIG_FILES)
	aclocal
	automake --add-missing --foreign || true
	autoconf
	touch $(BUILT_CONFIG_FILES)

-include config.mk

######

DESTDIR :=

export ATSHOME
export ATSHOMERELOC
export ATSHOMEQ

######

ATSHOMEBIN = $(ATSHOMEQ)/bin

######

#
# HX-2011-06-01:
# This part is by Georg Bauhaus (bauhaus AT arcor DOT de):
# It addresses the issue that the [-D] option is not available
# for $(INSTALL) on MacOSX.
#
.PHONY: install_dirs

install_dirs:: config.h
#
# make all subdirectories needed by install.
#
	cd $(abs_top_srcdir)
	[ -d $(DESTDIR)/$(bindir) ] || $(MKDIR_P) $(DESTDIR)/$(bindir)
	$(MKDIR_P) $(DESTDIR)$(ATSNEWHOME)/bin
	find ccomp contrib doc libats libc prelude -type d \
	  -exec $(MKDIR_P) $(DESTDIR)$(ATSNEWHOME)/\{} \; \
	  -print

install_files:: install_dirs
#
# recursively install all files in the list except .svn control files.
#
	for d in ccomp/runtime contrib doc libats libc prelude; do \
	  cd $(abs_top_srcdir) && \
	  $(INSTALL) -d $(DESTDIR)$(ATSNEWHOME)/"$$d" && \
	  find "$$d" -name .svn -prune -o -type f \
            -exec $(INSTALL) -m 644 \{} $(DESTDIR)$(ATSNEWHOME)/\{} \; \
	    -print && \
	  find "$$d" -name .svn -prune -o -type l \
            -exec cp -d \{} $(DESTDIR)$(ATSNEWHOME)/\{} \; \
	    -print; \
	done
#
# install specific files in the list as regular files.
#
	for f in \
	    COPYING INSTALL *.txt ccomp/lib/*.a ccomp/lib64/*.a config.h; \
	do \
	  [ -f "$$f" ] || continue; \
	  cd $(abs_top_srcdir) && \
	  $(INSTALL) -m 644 "$$f" $(DESTDIR)$(ATSNEWHOME)/"$$f" && \
	  echo "$$f"; \
	done
#
# install specific files in the list as executables.
#
	for f in bin/*; do \
	  cd $(abs_top_srcdir) && \
	  $(INSTALL) -m 755 "$$f" $(DESTDIR)$(ATSNEWHOME)/"$$f" && \
	  echo "$$f"; \
	done
#
# install multiple copies of wrapper script, for each binary.
#
	for f in bin/*; do \
	  b=`basename "$$f"`; \
	  cd $(abs_top_srcdir) && \
	  $(INSTALL) -m 755 ats_env.sh $(DESTDIR)$(bindir)/"$$b" && \
	  echo install ats_env.sh to $(bindir)/"$$b"; \
	done

install:: install_files

######

test::
	sh test.sh

######

all:: all-anairiats

#
# HX: [all1] is the entry point for bootstrapping with ATS/Geizella
#
all-geizella:: atsopt0-geizella
all-geizella::all1

#
# HX: [all1] is the entry point for bootstrapping with ATS/Anairiats
#
all-anairiats:: atsopt0-anairiats
all-anairiats:: all1

######

all1:: bootstrapping
all1:: atsopt1
all1:: bin/atscc
all1:: bin/atslib
all1:: libfiles libfiles_mt
all1:: bin/atspack
all1:: bin/atslex
all1:: ccomp/runtime/GCATS/gc.o
all1:: ccomp/runtime/GCATS/gc_mt.o
all1:: atsopt1_gc
all1:: contrib
all1:: ; @echo "ATS/Anairiats has been built up successfully!"
all1:: ; @echo "The value of ATSHOME for this build is \"$(ATSHOME)\"."
all1:: ; @echo "The value of ATSHOMERELOC for this build is \"$(ATSHOMERELOC)\"."

###### w/o GC ######

atsopt0:: atsopt0-anairiats

#
# bootstrapping via ocaml
#
atsopt0-geizella: ; $(MAKE) -C bootstrap0 -f ./Makefile atsopt

#
# bootstrapping via gcc
#
atsopt0-anairiats: ; $(MAKE) -C bootstrap0 -f ./Makefile atsopt

###### bootstrapping ######

bootstrapping:: ; $(MAKE) -C src -f ./Makefile_srcbootstrap all

###### w/o GC ######

atsopt1:: ; $(MAKE) -C bootstrap1 -f ../Makefile_bootstrap atsopt
atsopt1:: ; $(CPF) bootstrap1/atsopt $(ATSHOMEBIN)/atsopt

###### with GC ######

atsopt1_gc:: ; $(MAKE) -C bootstrap1 -f ../Makefile_bootstrap atsopt_gc
atsopt1_gc:: ; $(CPF) bootstrap1/atsopt_gc $(ATSHOMEBIN)/atsopt

###### contrib libraries ######

contrib::
ifeq (1,1)
	$(MAKE) -C contrib/parcomb all
endif
ifeq ($(HAVE_LIBGLIB20),1)
	$(MAKE) -C contrib/glib all
endif
ifeq ($(HAVE_LIBGTK20),1)
	$(MAKE) -C contrib/cairo all
	$(MAKE) -C contrib/pango all
	$(MAKE) -C contrib/GTK all
endif
ifeq ($(HAVE_LIBSDL10),1)
	$(MAKE) -C contrib/SDL all
endif

###### some toplevel commands ######

bin/atscc bin/atslib:
	$(MAKE) -C utils/scripts atscc
	$(CPF) utils/scripts/atscc $(ATSHOMEBIN)
	$(MAKE) -C utils/scripts atslib
	$(CPF) utils/scripts/atslib $(ATSHOMEBIN)
	$(MAKE) -C utils/scripts clean

bin/atspack:
	$(MAKE) -C utils/scripts atspack
	$(CPF) utils/scripts/atspack $(ATSHOMEBIN)

###### library ######

ATS_PROOFCHECK=
# ATS_PROOFCHECK=-D_ATS_PROOFCHECK # it should be turned on from time to time

#
# [CC -E] for preprocessing
#

ATSLIB=$(ATSHOMEBIN)/atslib

.libfiles_local: .libfiles ; $(CC) -E -P -x c -o $@ $<
libfiles: .libfiles_local
	$(ATSLIB) $(ATS_PROOFCHECK) -O2 --libats
	$(ATSLIB) $(ATS_PROOFCHECK) -O2 --libats_lex
	$(ATSLIB) $(ATS_PROOFCHECK) -O2 --libats_smlbas

lib32files: .libfiles_local
	$(ATSLIB) $(ATS_PROOFCHECK) -m32 -O2 --libats
	$(ATSLIB) $(ATS_PROOFCHECK) -m32 -O2 --libats_lex
	$(ATSLIB) $(ATS_PROOFCHECK) -m32 -O2 --libats_smlbas

lib64files: .libfiles_local
	$(ATSLIB) $(ATS_PROOFCHECK) -m64 -O2 --libats
	$(ATSLIB) $(ATS_PROOFCHECK) -m64 -O2 --libats_lex
	$(ATSLIB) $(ATS_PROOFCHECK) -m64 -O2 --libats_smlbas

.libfiles_mt_local: .libfiles_mt ; $(CC) -E -P -x c -o $@ $<
libfiles_mt: .libfiles_mt_local
	$(ATSLIB) $(ATS_PROOFCHECK) -O2 -D_ATS_MULTITHREAD --libats_mt

###### a lexer for ATS ######

bin/atslex:
	$(MAKE) -C utils/atslex atslex
	$(CPF) utils/atslex/atslex $(ATSHOMEBIN)
	$(MAKE) -C utils/atslex atslex clean

###### GC runtime ######

ccomp/runtime/GCATS/gc.o:
	$(MAKE) -C ccomp/runtime/GCATS gc.o
	$(MAKE) -C ccomp/runtime/GCATS clean

ccomp/runtime/GCATS/gc_mt.o:
	$(MAKE) -C ccomp/runtime/GCATS gc_mt.o
	$(MAKE) -C ccomp/runtime/GCATS clean

######

package::
	bin/atspack --source

precompiled::
	bin/atspack --precompiled
	rm -fr usr/share/atshome
	mv ats-lang-anairiats-* usr/share/atshome
	tar -zvcf ats-lang-anairiats-precompiled.tar.gz \
          --exclude=usr/.svn --exclude=usr/bin/.svn --exclude=usr/share/.svn usr/

######

srclines::
	$(MAKE) -C src lines

liblines::
	wc -l \
          prelude/*/*.?ats \
          prelude/*/*/*.?ats \
          libc/*/*.?ats \
          libc/*/*/*.?ats \
          libats/*/*.?ats \
          libats/*/*/*.?ats \

######

CPF=cp -f
RMF=rm -f

######

clean::
	$(RMF) bootstrap0/*.o
	$(RMF) bootstrap1/*.c
	$(RMF) bootstrap1/*.h
	$(RMF) bootstrap1/*.cats
	$(RMF) bootstrap1/*.o

cleanall:: clean
	$(RMF) $(BUILT_CONFIG_FILES)
	$(RMF) .libfiles_local
	$(RMF) .libfiles_mt_local
	$(RMF) bootstrap0/atsopt
	$(RMF) bootstrap1/atsopt
	$(RMF) src/ats_grammar_yats.c src/ats_grammar_yats.h
	$(RMF) bin/atsopt bin/atscc bin/atslib bin/atslex bin/atspack
	$(RMF) ccomp/lib/libats.a
	$(RMF) ccomp/lib/libats_mt.a
	$(RMF) ccomp/lib/libats_lex.a
	$(RMF) ccomp/lib/libats_smlbas.a
	$(RMF) ccomp/lib/output/*
	$(RMF) ccomp/lib64/libats.a
	$(RMF) ccomp/lib64/libats_mt.a
	$(RMF) ccomp/lib64/libats_lex.a
	$(RMF) ccomp/lib64/libats_smlbas.a
	$(RMF) ccomp/lib64/output/*
	$(RMF) contrib/glib/atsctrb_glib.o
	$(RMF) contrib/cairo/atsctrb_cairo.o
	$(RMF) contrib/pango/atsctrb_pango.o
	$(RMF) contrib/X11/atsctrb_X11.o
	$(RMF) contrib/GTK/atsctrb_GTK.o
	$(RMF) contrib/GL/atsctrb_GL.o
	$(RMF) contrib/SDL/atsctrb_SDL.o

cleanall:: ; $(MAKE) -C utils/atslex -f ./Makefile cleanall
cleanall:: ; $(MAKE) -C utils/scripts -f ./Makefile cleanall
cleanall:: ; $(MAKE) -C ccomp/runtime/GCATS -f ./Makefile cleanall

distclean:: cleanall
distclean:: ; find . -name .svn -prune -o -name \*~ -exec rm \{} \;

###### end of [Makefile] ######