File: rules

package info (click to toggle)
hol88 2.02.19940316-35
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 65,988 kB
  • ctags: 21,623
  • sloc: ml: 199,939; ansic: 9,666; sh: 7,118; makefile: 6,095; lisp: 2,747; yacc: 894; sed: 201; cpp: 87; awk: 5
file content (231 lines) | stat: -rwxr-xr-x 8,599 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
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
#
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
#
# Modified to make a template file for a multi-binary package with separated
# build-arch and build-indep targets  by Bill Allombert 2001

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This has to be exported to make some magic below work.
export DH_OPTIONS

PN:=hol88
VR:=$(shell awk '{if (i) next;i=1;a=$$2;gsub("[()]","",a);split(a,A,"-");print A[1];}' debian/changelog)
PD:=$(PN)-$(VR)

CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
#	cat debian/dash.p | patch -p1
	touch configure-stamp


build: build-arch build-indep

build-arch: build-arch-stamp
build-arch-stamp: configure-stamp 

	echo '#-native-reloc(bye -1)' | gcl || cat debian/gcl_patch.l debian/gcl_save.l | gcl
	PATH=$$(pwd):$$PATH $(MAKE) all
	find -name "raw_*_map" -exec rm {} \;
	for i in $$(find -maxdepth 1 -name "*hol*"); do \
		printf 'install `'/usr/share/$(PD)'`;;\nlisp `(ml-save "foo")`;;\n' | ./$$i &&\
		mv foo $$i; done
	touch $@

build-indep: build-indep-stamp
build-indep-stamp: configure-stamp 


	for i in Manual/Tutorial/ack.tex Manual/Reference/ack.tex Manual/Description/ack.tex; do\
		ln -snf ../Latex/ack.tex $$i ; done
	for i in $$(find Library -name index.tex) Library/pred_sets/Manual/theorems.tex Library/record_proof/Manual/record_proof.ind ; do\
		[ -e $$i.sve ] || cp $$i $$i.sve ; done
	$(MAKE) -C Manual all
	touch $@

INSTALLA:=$(addprefix debian/,$(addsuffix .install,\
	hol88 hol88-library))
INSTALLI:=$(addprefix debian/,$(addsuffix .install,\
	hol88-source hol88-help hol88-library-source\
	hol88-library-help hol88-contrib-source hol88-contrib-help hol88-doc))
LINKS:=$(addprefix debian/,$(addsuffix .links,hol88 hol88-library))

clean:
	dh_testdir
	dh_testroot

#	! [ -e configure-stamp ] || cat debian/dash.p | patch -p1 -R
	rm -f build-arch-stamp build-indep-stamp configure-stamp

	[ ! -f Makefile ] || $(MAKE) clean
	[ ! -f Makefile ] || $(MAKE) clobber
	for i in $$(find Library -name index.tex) Library/pred_sets/Manual/theorems.tex Library/record_proof/Manual/record_proof.ind ; do\
		[ -e $$i.sve ] || cp $$i $$i.sve ; done
	[ ! -f Makefile ] || $(MAKE) -C Manual clean

	[ ! -f Makefile ] || for i in $$(find Library -name Manual); do $(MAKE) -C $$i clean ; done
	find -name X.tex -exec rm -rf {} \;

	dh_clean -X./ml/site.ml.orig -X./contrib/tooltool/Makefile.orig \
		 -X./contrib/tooltool/events.c.orig -X./contrib/tooltool/func_fix.c.orig \
	         -X./contrib/tooltool/lex.c.orig -X./contrib/tooltool/parse.y.orig \
		 -X./contrib/tooltool/patchlevel.h.orig -X./contrib/tooltool/windows.c.orig \
		 -X./contrib/Xhelp/hol_apro.orig -X./contrib/Xhelp/hol_ref.orig \
		 -X./contrib/Xhelp/xholhelp.h.orig -X./contrib/Xhelp/hol_thm.orig

	for i in $$(find Library -name "*.sve") ; do mv $$i $$(echo $$i | sed "s,\.sve,,1"); done

	rm -f $(INSTALLA) $(INSTALLI) $(LINKS) debian/hol88.sh
	find -name "*.dvi" -exec rm {} \;
	rm -f Manual/Tutorial/ack.tex Manual/Reference/ack.tex Manual/Description/ack.tex
	rm -f Manual/Covers/titlepages.ps Manual/Covers/endpages.ps
	rm -f bm.l foo* gcl ./lisp/f-ol-syntax.data
	cp debian/site_ml_orig ml/site.ml.orig
	rm -f   Library/finite_sets/Manual/entries.tex \
		Library/finite_sets/Manual/theorems.tex \
		Library/more_arithmetic/Manual/theorems.tex \
		Library/numeral/Manual/theorems.tex \
		Library/pred_sets/Manual/entries.tex \
		Library/prettyp/Manual/entries.tex \
		Library/reals/Manual/theorems.tex \
		Library/res_quan/Manual/entries.tex \
		Library/sets/Manual/entries.tex \
		Library/sets/Manual/theorems.tex \
		Library/string/Manual/theorems.tex \
		Library/wellorder/Manual/theorems.tex \
		Library/word/Manual/theorems.tex \
		Manual/Reference/entries.tex \
		Manual/Reference/theorems.tex



debian/hol88.install:: 
	find -maxdepth 1 -name "*hol*" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/lib/$(PD)/%s\n",$$1,a);}' >>$@
	echo debian/hol88.sh usr/bin >>$@
debian/hol88-source.install:: 
	find lisp -name "*.l" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
	find ml -type f -name "*ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
	find theories -type f -name "*ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
	find theories -type f -name "*th" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
debian/hol88-help.install:: 
	find help -name "*.doc" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@

debian/hol88-library.install:: 
	find Library -name "*.o" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/lib/$(PD)/%s\n",$$1,a);}' >>$@
debian/hol88-library-source.install:: 
	find Library -name "*.ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
debian/hol88-library-help.install:: 
	find Library -name "*.doc" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@

debian/hol88-contrib-source.install:: 
	find contrib -name "*.ml" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
	find contrib -name "Makefile" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@
debian/hol88-contrib-help.install:: 
	find contrib -name "*.doc" | awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/$(PD)/%s\n",$$1,a);}' >>$@

debian/hol88-doc.install:: 
	find Manual -name "*dvi" | grep -v makeindex | grep -v psfig | \
		awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/doc/hol88-doc/%s\n",$$1,a);}' >>$@
	find Manual -name "*ps" | grep -v makeindex | grep -v psfig | \
		awk '{a=$$1;sub("/[^/]*$$","",a);printf("%s usr/share/doc/hol88-doc/%s\n",$$1,a);}' >>$@


debian/hol88.links:: 
	find * -maxdepth 0 -name "*hol*" | awk '{printf("/usr/lib/$(PD)/%s usr/share/$(PD)/%s\n",$$1,$$1);}' >>$@
debian/hol88-library.links:: 
	find Library -name "*.o" | awk '{printf("/usr/lib/$(PD)/%s usr/share/$(PD)/%s\n",$$1,$$1);}' >>$@


debian/hol88.sh:
	echo "#!/bin/bash" >$@
	echo >>$@
	echo "exec /usr/lib/$(PD)/hol" >>$@
	chmod 755 $@


install: install-indep install-arch
install-indep: $(INSTALLI)
	dh_testdir
	dh_testroot
	dh_prep -i -X./ml/site.ml.orig -X./contrib/tooltool/Makefile.orig \
		 -X./contrib/tooltool/events.c.orig -X./contrib/tooltool/func_fix.c.orig \
	         -X./contrib/tooltool/lex.c.orig -X./contrib/tooltool/parse.y.orig \
		 -X./contrib/tooltool/patchlevel.h.orig -X./contrib/tooltool/windows.c.orig \
		 -X./contrib/Xhelp/hol_apro.orig -X./contrib/Xhelp/hol_ref.orig \
		 -X./contrib/Xhelp/xholhelp.h.orig -X./contrib/Xhelp/hol_thm.orig

	dh_installdirs -i

	dh_install -i

install-arch: $(INSTALLA) $(LINKS) debian/hol88.sh
	dh_testdir
	dh_testroot
	dh_prep -a -X./ml/site.ml.orig -X./contrib/tooltool/Makefile.orig \
		 -X./contrib/tooltool/events.c.orig -X./contrib/tooltool/func_fix.c.orig \
	         -X./contrib/tooltool/lex.c.orig -X./contrib/tooltool/parse.y.orig \
		 -X./contrib/tooltool/patchlevel.h.orig -X./contrib/tooltool/windows.c.orig \
		 -X./contrib/Xhelp/hol_apro.orig -X./contrib/Xhelp/hol_ref.orig \
		 -X./contrib/Xhelp/xholhelp.h.orig -X./contrib/Xhelp/hol_thm.orig

	dh_installdirs -a

	dh_install -a

	mv debian/hol88/usr/bin/hol88.sh debian/hol88/usr/bin/hol88

binary-common:
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate	
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_lintian
	dh_link
	dh_strip
	dh_compress 
	dh_fixperms
#	dh_perl
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb
# Build architecture independant packages using the common target.
binary-indep: build-indep install-indep
	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common

# Build architecture dependant packages using the common target.
binary-arch: build-arch install-arch
	$(MAKE) -f debian/rules DH_OPTIONS=-a binary-common

binary: binary-arch binary-indep
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure