summaryrefslogtreecommitdiff
path: root/ipl/Makefile
blob: fc01edf047a029734f8c95fd663b171a763deeca (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
#  Makefile for the Icon Program Library


All:	Ilib Ibin


#  Make a library distribution (portable ucode and include files).

Ilib:	cfuncs/libcfunc.so
cfuncs/libcfunc.so:  ../bin/icont
	cp incl/*.icn gincl/*.icn cfuncs/icall.h ../lib
	cd procs;  LPATH= ../../bin/icont -usc *.icn; mv *.u? ../../lib
	cd gprocs; LPATH= ../../bin/icont -usc *.icn; mv *.u? ../../lib
	if grep '^ *# *define LoadFunc' ../src/h/define.h >/dev/null; \
	   then $(MAKE) Cfunctions; fi


#  Make C functions.  Only called if LoadFunc is defined.

Cfunctions:
	cd cfuncs; LPATH= $(MAKE) ICONT=../../bin/icont
	cp cfuncs/*.u? ../lib
	cp cfuncs/libcfunc.so ../bin


#  Make selected graphics program binaries (platform-dependent icode)
#  for ../bin, given that ../lib is ready

Ibin:	gpacks/vib/vib
gpacks/vib/vib:  ../bin/icont
	MAKE=$(MAKE) ./BuildBin


#  Make a full set of program binaries (not usually done) in ./iexe,
#  given that ../lib is ready

Iexe:
	rm -f iexe/*
	MAKE=$(MAKE) ./BuildExe


#  Check for undefined identifiers in ../lib.
#  (A few are expected: references to Mp, program, init, goal).

Undef:
	cd ../lib; for f in *.u2; do (echo $$f; icont -us -fs $$f); done


#  Check for stray files

Strays:
	for d in *procs *progs *incl; do (cd $$d; pwd; gcomp CVS *.icn); done


#  Verify that all procedures and programs build, including packs,
#  and perform some other sanity checks

Check:
	./CheckAll


#  Make Zip files for separate distribution of the library

ZipFiles:  Ilib
	rm -rf ilib *.zip
	zip -qrX9 bipl.zip docs incl procs progs packs data cfuncs -x '*/CVS/*'
	zip -qrX9 gipl.zip gdocs gincl gprocs gprogs gpacks gdata  -x '*/CVS/*'
	mkdir ilib
	cp ../lib/*.* ilib
	zip -qrX9 ilib.zip ilib
	rm -rf ilib


#  Clean up.

Clean Pure:
	-rm -rf ilib iexe *.zip */*.u[12] */*.zip */*.so *packs/*/*.exe
	-rm -f xx `find *procs *progs -type f -perm -100 -print`
	for d in cfuncs *packs/[abcdefghijklmnopqrstuvwxyz]*; do \
	    echo "+ cd ipl/$$d"; \
	    (cd $$d; $(MAKE) Clean 2>/dev/null) || echo "[not cleaned]"; done