summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/Makefile.in
blob: 13040078e887f0970966dbfebe1ea5d2e9366858 (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
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
# @configure_input@

ARCH = unix
POLL = poll

GC = @GCDIR@
GCOPTIONS = @GCOPTIONS@
GCLIB = @GCLIB@
GCPPLIB = @GCPPLIB@
GCLIBS = $(GCPPLIB) $(GCLIB)
LFLAGS = @LDFLAGS@
LIBS = $(LFLAGS) @LIBS@ $(GCLIBS)

vpath %.cc prc

CAMP = camperror path drawpath drawlabel picture psfile texfile util settings \
       guide flatguide knot drawfill path3 drawpath3 drawsurface

RUNTIME_FILES = runtime runbacktrace runpicture runlabel runhistory runarray \
	runfile runsystem runpair runtriple runpath runpath3d runstring \
	runmath

# Files to be scanned for pre-translated symbols defined by SYM(name).
SYMBOL_FILES = types builtin gsl $(RUNTIME_FILES)

PRC =  PRCbitStream oPRCFile PRCdouble writePRC

FILES = $(CAMP) $(SYMBOL_FILES) env genv main stm dec errormsg \
        callable name symbol entry exp newexp stack camp.tab lex.yy \
	access virtualfieldaccess absyn record interact fileio \
	fftw++ simpson coder coenv \
	@getopt@ locate parser program application varinit fundec refaccess \
	envcompleter process constructor array Delaunay predicates \
	$(PRC) glrender tr arcball algebra3 quaternion svnrevision

DIST = camp.tab.h camp.tab.cc lex.yy.cc runtime.h runtime.cc keywords.cc \
	asy-keywords.el
NAME = asy
XNAME = x$(NAME)
CLEAN = camp.output asy.list svnrevision.cc doc/version.texi \
        $(SYMBOL_FILES:=.symbols.h) allsymbols.h opsymbols.h \
        GUI/xasyVersion.py $(XNAME) 
EXTRA = asy-mode.el asy-init.el asy.vim asy-kate.sh asymptote.py reload.js \
        nopapersize.ps
EXEXTRA = piicon.eps *.views *.dat
DOCEXTRA = *.asy *.csv *.dat latexusage.tex externalprc.tex pixel.pdf
KEYWORDS = base $(ASYMPTOTE_SITEDIR)
LATEXFILES = asymptote.sty asycolors.sty ocg.sty
CONTEXTFILES = colo-asy.tex
ASY = ./asy -dir base -config "" -render=0

DEFS = @DEFS@ @OPTIONS@ \
       -DPRESYM -DFASTCAST -DCALLEE_SEARCH -DEXACT_MATCH -DTEST_ADDED_OPS \
	   -DNO_FUNC_OPS
CFLAGS = @CPPFLAGS@ @CFLAGS@
OPTS = $(DEFS) $(CFLAGS)
INCL = -I . @INCL@

CXX = @CXX@ -Wall -ansi
CC = @CC@ -Wall -ansi
MAKEDEPEND = $(OPTS) -O0 -M -DDEPEND
BISON = bison
LEX = @LEX@

prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
bindir = $(DESTDIR)@bindir@
mandir = $(DESTDIR)@mandir@
infodir = $(DESTDIR)@infodir@
datadir = $(DESTDIR)@datadir@
asydir = $(datadir)/asymptote
GUIdir = $(asydir)/GUI
docdir = $(DESTDIR)@docdir@
exampledir = $(docdir)/examples
animationsdir = $(exampledir)/animations
latexdir = $(DESTDIR)@latexdir@
contextdir = $(DESTDIR)@contextdir@
INSTALL = @INSTALL@
REVISION = "const char *SVN_REVISION="
revision = `svn info 2>/dev/null | grep 'Revision' | sed -e 's/Revision: \(.*\)/-r\1/'`
last = `cat svnrevision.cc | sed -e 's/.*\"\(.*\)\";/\\1/'`

export prefix docdir exampledir mandir infodir INSTALL MAKE DESTDIR TEXI2DVI

asy: $(GCLIB) $(FILES:=.o)
	if test "$(revision)" != "$(last)"; then \
	  echo $(REVISION)\"$(revision)\"\; > svnrevision.cc; \
	  $(CXX) $(OPTS) $(INCL) -o svnrevision.o -c svnrevision.cc; \
	fi
	echo string VERSION=\"@VERSION@$(revision)\"\; > base/version.asy
	echo @set VERSION @VERSION@$(revision) > doc/version.texi
	echo @set Datadir @datadir@ >> doc/version.texi
	echo "#!/usr/bin/env python" > GUI/xasyVersion.py
	echo xasyVersion = \"@VERSION@$(revision)\" >> GUI/xasyVersion.py
	ln -sf GUI/xasy.py $(XNAME)
	$(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) $(LIBS)

svnrevision.cc:
	echo $(REVISION)\"\"\; > svnrevision.cc;

msdos: $(GCLIB) $(FILES:=.o) asy.o
	echo string VERSION=\"@VERSION@\"\; > base/version.asy
	echo @set VERSION @VERSION@ > doc/version.texi
	echo @set Datadir @datadir@ >> doc/version.texi
	echo "#!/usr/bin/env python" > GUI/xasyVersion.py
	echo xasyVersion = \"@VERSION@\" >> GUI/xasyVersion.py
	$(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) asy.o $(LIBS) -s -static

asy.o:	asy.rc asy.ico Makefile
	cat asy.rc | sed -e "s/ASYMPTOTE_VERSION/@VERSION@$(revision)/" | \
	windres -o asy.o

all:  	asy man faq asy-keywords.el

$(GCLIB): $(GC).tar.gz
	gunzip -c $(GC).tar.gz > $(GC).tar
	tar -xf $(GC).tar
	rm -f $(GC).tar
	if test "$(GC)" = "gc6.8"; then \
	  cd $(GC)/include && patch < ../../patches/gc6.8_AIX.patch; \
	fi
	if test "$(GC)" = "gc-7.0"; then \
	  cd $(GC)/include/private && \
            patch < ../../../patches/gc-7.0nomem.patch;\
	fi
	cd $(GC); \
	./configure $(GCOPTIONS); \
	$(MAKE) check

$(GCPPLIB): $(GCLIB)

dvi:	asy
	cd doc && $(MAKE) dvi

html:	asy
	cd doc && $(MAKE) doc

man:	asy
	cd doc && $(MAKE) man

faq:	asy
	cd doc && $(MAKE) faq

$(RUNTIME_FILES:=.cc): %.cc: runtime.pl opsymbols.h runtimebase.in %.in
	./runtime.pl $(@:.cc=)

$(SYMBOL_FILES:=.symbols.h): %.symbols.h: findsym.pl %.cc
	$(CXX) -E -DNOSYM $(OPTS) $(INCL) $(@:.symbols.h=.cc) | \
          ./findsym.pl $@ -

$(SYMBOL_FILES:=.o): %.o: %.symbols.h

allsymbols.h: findsym.pl $(SYMBOL_FILES:=.cc)
	$(CXX) -E -DNOSYM $(OPTS) $(INCL) $(SYMBOL_FILES:=.cc) | \
          ./findsym.pl $@ -

symbol.o: opsymbols.h allsymbols.h

camp.tab.cc: camp.y
	$(BISON) -dvt -b camp camp.y && mv camp.tab.c camp.tab.cc

camp.tab.h: camp.tab.cc

lex.yy.cc: camp.l
	$(LEX) -d -olex.yy.cc camp.l

lex.yy.d: $(GCLIB) lex.yy.cc camp.tab.h

keywords.cc: keywords.pl camp.l process.cc
	./keywords.pl

opsymbols.h: opsymbols.pl camp.l
	./opsymbols.pl

envcompleter.d: keywords.cc

asy-keywords.el: asy
	@echo Creating $@;
	$(ASY) -l > asy.list
	ls $(addsuffix /*.asy,$(KEYWORDS)) | grep -v plain\* | \
          grep -v three_\* | grep -v featpost3D | xargs $(ASY) -l >> asy.list
	./asy-list.pl asy.list @VERSION@

install: asy-keywords.el install-texhash install-man

install-all: asy-keywords.el install-texhash install-html

install-texhash: install-asy
	-if test -z "$(DESTDIR)"; then \
	  texhash; \
	fi

install-asy: asy
	${INSTALL} -d $(bindir) $(asydir) $(GUIdir) $(exampledir) \
          $(animationsdir)
	-${INSTALL} -d $(latexdir)
	-${INSTALL} -d $(contextdir)
	${INSTALL} -p -m 755 $(NAME) $(bindir)
	${INSTALL} -p -m 644 asy-keywords.el base/*.asy \
          $(addprefix base/,$(EXTRA)) $(asydir)
	${INSTALL} -p -m 755 GUI/*.py $(GUIdir)
	ln -sf @datadir@/asymptote/GUI/xasy.py $(bindir)/$(XNAME)
	${INSTALL} -p -m 644 examples/*.asy $(addprefix examples/,$(EXEXTRA)) \
	  doc/extra/*.asy $(addprefix doc/,$(DOCEXTRA)) $(exampledir)
	${INSTALL} -p -m 644 examples/animations/*.asy \
          examples/animations/inlinemovie.tex \
	  examples/animations/inlinemovie3.tex $(animationsdir)
	-${INSTALL} -p -m 644 $(addprefix doc/,$(LATEXFILES)) $(latexdir)
	-${INSTALL} -p -m 644 $(addprefix doc/,$(CONTEXTFILES)) $(contextdir)

install-html: html
	cd doc && $(MAKE) install-all

install-man: man
	cd doc && $(MAKE) install

install-prebuilt: install-asy
	cd doc && $(MAKE) install-prebuilt

uninstall: uninstall-all

uninstall-all: uninstall-man uninstall-asy

uninstall-asy:
	-cd $(animationsdir) && rm -f *.asy *.tex
	-rmdir $(animationsdir)
	-cd $(exampledir) && rm -f $(EXEXTRA) $(DOCEXTRA)
	-rmdir $(exampledir)
	-rmdir $(docdir)
	-cd $(GUIdir) && rm -f *.py
	-rmdir $(GUIdir)
	-cd $(asydir) && rm -f asy-keywords.el *.asy $(EXTRA)
	-rmdir $(asydir)
	-cd $(latexdir) && rm -f $(LATEXFILES)
	-rmdir $(latexdir)
	-cd $(contextdir) && rm -f $(CONTEXTFILES)
	-rmdir $(contextdir)
	-cd $(bindir) && rm -f $(NAME) $(XNAME)

uninstall-man: 
	cd doc && $(MAKE) uninstall

clean:  FORCE
	-rm -f asy *.o *.d *mon.out $(CLEAN)

gc-clean: FORCE clean
	-if test -d $(GC); then \
		$(MAKE) -C $(GC) clean; \
	fi

cleaner: FORCE clean
	-if test -d $(GC); then \
		rm -rf $(GC); \
	fi
	-rm -f Makefile config.h config.log config.status errors.temp
	cd doc && $(MAKE) clean
	cd tests && $(MAKE) distclean

distclean: FORCE cleaner
	cd doc && $(MAKE) distclean

cleanest: FORCE maintainer-clean
maintainer-clean: FORCE distclean
	-rm -f configure config.h.in $(DIST)
	-rm -rf autom4te.cache

check: asy FORCE
	./wce
	$(MAKE) -C tests

check-all: asy FORCE
	./wce
	$(MAKE) -C tests all

.SUFFIXES: .c .cc .o .d
.cc.o:
	$(CXX) $(OPTS) $(INCL) -o $@ -c $<
.cc.d:
	@echo Creating $@; \
	rm -f $@; \
	${CXX} $(MAKEDEPEND) $(INCL) $(MDOPTS) $< > $@.$$$$ 2>/dev/null && \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	rm -f $@.$$$$
.c.d:
	@echo Creating $@; \
	rm -f $@; \
	${CC} $(MAKEDEPEND) $(INCL) $(MDOPTS) $< > $@.$$$$ 2>/dev/null && \
	sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
	rm -f $@.$$$$

ifeq (,$(findstring clean,${MAKECMDGOALS}))
-include $(FILES:=.d)
endif

FORCE:

configure: configure.ac
	autoheader && autoconf

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck