File: rules

package info (click to toggle)
freecell-solver 2.4.1-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,880 kB
  • ctags: 1,155
  • sloc: ansic: 13,110; sh: 8,793; python: 342; perl: 323; makefile: 186
file content (245 lines) | stat: -rwxr-xr-x 6,889 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/make -f 

PACKAGEshd=libfreecell-solver0
PACKAGEdev=libfreecell-solver-dev
PACKAGEbin=freecell-solver-bin


arch	= $(shell dpkg --print-architecture)
tmp	= debian/tmp
tmp-dev = debian/tmp-dev
tmp-bin = debian/tmp-bin

docdir		= usr/share/doc
mandir		= usr/share/man
bindir 		= usr/bin

build: config.status
	test -e debian/control
	$(MAKE)


config.status:
	./configure \
	--prefix=/usr \
	--enable-states-type=indirect \
	--enable-max-num-freecells=8 \
	--enable-max-num-initial-cards-per-stack=104 \
	--enable-max--num-stacks=12 \
	--enable-max-num-decks=2 


binary-indep: build

#Build our packages.
binary-arch: build testroot debian/control
	#
	# Build libfreecell-solver0 package
	#
	
	make prefix=`pwd`/$(tmp)/usr install
	install -d --mode=755 $(tmp)/$(docdir)/$(PACKAGEshd)
	install -d --mode=755 $(tmp)/DEBIAN
	
	#
	# Remove cruft 
	#
	
	rm -rf $(tmp)/usr/bin
	rm -rf $(tmp)/usr/include
	rm -f $(tmp)/usr/lib/*a
	rm -f $(tmp)/usr/lib/libfreecell-solver.so
	rm -rf $(tmp)/usr/man
	
	#
	# Install documentation
	#
	
	install --mode=644 "debian/copyright" $(tmp)/$(docdir)/$(PACKAGEshd)
	install --mode=644 "debian/changelog" \
	    $(tmp)/$(docdir)/$(PACKAGEshd)/changelog.Debian
	install --mode=644 "ChangeLog" \
		$(tmp)/$(docdir)/$(PACKAGEshd)/changelog
	install --mode=644 "NEWS"	      $(tmp)/$(docdir)/$(PACKAGEshd)
	install --mode=644 "README"	      $(tmp)/$(docdir)/$(PACKAGEshd)
	install --mode=644 "TODO"	      $(tmp)/$(docdir)/$(PACKAGEshd)
	install --mode=644 "CREDITS"	      $(tmp)/$(docdir)/$(PACKAGEshd)
	
	#
	# Compress changelogs
	#
	
	gzip -9f $(tmp)/$(docdir)/$(PACKAGEshd)/changelog*
	
	#
	# Strip the so and change its permssions.
	#
	
	strip --strip-all -R .comment -R .note \
	    $(tmp)/usr/lib/libfreecell-solver.so.*
	chmod 644 $(tmp)/usr/lib/libfreecell-solver.so.*
	
	#
	# Install package scripts
	#
	
	install --mode=644 debian/libfreecell-solver0.shlibs $(tmp)/DEBIAN/shlibs
	install --mode=755 debian/postinst.shd $(tmp)/DEBIAN/postinst
	cat debian/prerm.generic | sed 's/__PKG__/$(PACKAGEshd)/g' > \
	     $(tmp)/DEBIAN/prerm 
	chmod 755 $(tmp)/DEBIAN/prerm $(tmp)/DEBIAN/postinst
	dpkg-shlibdeps $(tmp)/usr/lib/libfreecell-solver.so.*
	dpkg-gencontrol -ips -P$(tmp) -p$(PACKAGEshd)
	dpkg --build $(tmp) ..
	
	#----------------------------------------------------------------------#
	#
	# Build libfreecell-solver-dev package
	#
	
	make prefix=`pwd`/$(tmp-dev)/usr install
	install -d --mode=755 $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	install -d --mode=755 $(tmp-dev)/DEBIAN
	
	#
	# Remove cruft
	#
	
	rm -rf $(tmp-dev)/usr/lib/*so*0*
	rm -rf $(tmp-dev)/usr/lib/*.la*
	rm -rf $(tmp-dev)/usr/bin
	rm -rf $(tmp-dev)/usr/man
	
	install -d --mode=755 $(tmp-dev)/usr/bin
	install --mode=755 "freecell-solver-config" $(tmp-dev)/usr/bin
	
	#
	# Install documentation
	#
	
	install --mode=644 "debian/copyright" $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	install --mode=644 "debian/changelog" \
	    $(tmp-dev)/$(docdir)/$(PACKAGEdev)/changelog.Debian
	install --mode=644 "ChangeLog" \
		$(tmp-dev)/$(docdir)/$(PACKAGEdev)/changelog
	install --mode=644 "NEWS"	      $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	install --mode=644 "README"	      $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	install --mode=644 "TODO"	      $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	install --mode=644 "CREDITS"	      $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	install --mode=644 `find devel_docs -type f -maxdepth 1`        $(tmp-dev)/$(docdir)/$(PACKAGEdev)
	
	install -d --mode=755 $(tmp-dev)/usr/share/lintian/overrides
	install --mode=644 "debian/libfreecell-solver-dev.lintian" $(tmp-dev)/usr/share/lintian/overrides/libfreecell-solver-dev
	
	#
	# Strip the .a
	#
	
	strip --strip-debug $(tmp-dev)/usr/lib/libfreecell-solver.a
	
	#
	# Compress changelogs
	#
	
	gzip -9f $(tmp-dev)/$(docdir)/$(PACKAGEdev)/changelog*
	
	#
	# Install special files
	#
	
	cat debian/postinst.generic | sed 's/__PKG__/$(PACKAGEdev)/g' > \
	     $(tmp-dev)/DEBIAN/postinst
	cat debian/prerm.generic | sed 's/__PKG__/$(PACKAGEdev)/g' > \
	     $(tmp-dev)/DEBIAN/prerm 
	chmod 755 $(tmp-dev)/DEBIAN/prerm $(tmp-dev)/DEBIAN/postinst
	dpkg-gencontrol -ips -P$(tmp-dev) -p$(PACKAGEdev)
	dpkg --build $(tmp-dev) ..
	
	
	#----------------------------------------------------------------------#
	#
	# Build freecell-solver-bin package
	#
	
	make prefix=`pwd`/$(tmp-bin)/usr install
	mv $(tmp-bin)/usr/bin/pi-make-microsoft-freecell-board $(tmp-bin)/usr/bin/make-microsoft-freecell-board
	rm $(tmp-bin)/usr/bin/freecell-solver-range-parallel-solve
	rm $(tmp-bin)/usr/bin/freecell-solver-config

	install -d --mode=755 $(tmp-bin)/$(docdir)/$(PACKAGEbin)
	install -d --mode=755 $(tmp-bin)/DEBIAN
	install -d --mode=755 $(tmp-bin)/$(mandir)/man6
	
	#
	# Remove cruft
	#
	
	rm -rf $(tmp-bin)/usr/man
	rm -rf $(tmp-bin)/usr/lib/
	rm -rf $(tmp-bin)/usr/include/
	
	#
	# Strip stuff
	#
	
	strip --strip-all -R .comment -R .note $(tmp-bin)/usr/bin/*board
	strip --strip-all -R .comment -R .note $(tmp-bin)/usr/bin/fc-solve
	
	#
	# Install documentation
	#
	
	install --mode=644 "debian/copyright" \
	    $(tmp-bin)/$(docdir)/$(PACKAGEbin)/copyright
	install --mode=644 "debian/changelog" \
	    $(tmp-bin)/$(docdir)/$(PACKAGEbin)/changelog.Debian
	install --mode=644 "ChangeLog" \
		$(tmp-bin)/$(docdir)/$(PACKAGEbin)/changelog
	install --mode=644 "NEWS"	      $(tmp-bin)/$(docdir)/$(PACKAGEbin)
	install --mode=644 "USAGE"	      $(tmp-bin)/$(docdir)/$(PACKAGEbin)
	install --mode=644 "README"	      $(tmp-bin)/$(docdir)/$(PACKAGEbin)
	install --mode=644 "TODO"	      $(tmp-bin)/$(docdir)/$(PACKAGEbin)
	install --mode=644 "CREDITS"	      $(tmp-bin)/$(docdir)/$(PACKAGEbin)
	install --mode=644 "fc-solve.6"	      $(tmp-bin)/$(mandir)/man6
	install --mode=644 board_gen/*.6 \
		$(tmp-bin)/$(mandir)/man6
	mv $(tmp-bin)/$(mandir)/man6/pi-make-microsoft-freecell-board.6 $(tmp-bin)/$(mandir)/man6/make-microsoft-freecell-board.6
	#install --mode=644 debian/*.6 \
		#$(tmp-bin)/$(mandir)/man6
	
	#
	# Compress changelogs and man pages
	#
	
	gzip -9f $(tmp-bin)/$(docdir)/$(PACKAGEbin)/changelog*
	gzip -9f $(tmp-bin)/$(mandir)/man6/*
	
	#
	# Install special files
	#
	
	cat debian/postinst.generic | sed 's/__PKG__/$(PACKAGEbin)/g' > \
	     $(tmp-bin)/DEBIAN/postinst
	cat debian/prerm.generic | sed 's/__PKG__/$(PACKAGEbin)/g' > \
	     $(tmp-bin)/DEBIAN/prerm 
	chmod 755 $(tmp-bin)/DEBIAN/prerm $(tmp-bin)/DEBIAN/postinst
	dpkg-shlibdeps $(tmp-bin)/usr/bin/*board $(tmp-bin)/usr/bin/fc-solve
	dpkg-gencontrol -ips -P$(tmp-bin) -p$(PACKAGEbin)
	dpkg --build $(tmp-bin) ..
	

clean: testroot
	test -e debian/control
	rm -f debian/substvars debian/files *orig* *bak* debian/*bak
	rm -rf debian/tmp
	rm -rf debian/tmp-dev
	rm -rf debian/tmp-bin
	-$(MAKE) distclean
	rm -f config.h

binary: binary-indep binary-arch

testroot:
	test root = "`whoami`" || (echo Need root privelages; exit 1);

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