File: rules

package info (click to toggle)
atari-bootstrap 3.3-3
  • links: PTS
  • area: main
  • in suites: potato, woody
  • size: 468 kB
  • ctags: 528
  • sloc: ansic: 3,531; perl: 529; makefile: 115; sh: 26
file content (107 lines) | stat: -rwxr-xr-x 3,333 bytes parent folder | download
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
#!/usr/bin/make -f
# based on the sample debian/rules file for GNU hello by Ian Jackson.

#export DH_VERBOSE=1

pkg = atari-bootstrap
tmp = debian/tmp
lib = $(tmp)/usr/share/$(pkg)
sbin = $(tmp)/usr/sbin

# The binaries are only rebuilt if a cross compiler is available; otherwise,
# the precompiled binaries ataboot{,-bootp} are used
# If the binaries are build on a m68k system, /usr/src/linux is expected to
# point to newest kernel headers (>= 2.1.42 required!)
# If cross compiling on a non-m68k system, the complicated sed command
# determines the location of kernel headers from the default include dir of
# m68k-linux-gcc. It is expected that include/linux there is a *symlink* into
# the kernel source dir.
build:
	$(checkdir)
	@set -e; if false && type -p m68k-mint-gcc >/dev/null; then \
		echo "m68k-mint-gcc cross compiler available, building bootstrap"; \
		inc=/usr/src/linux/include; \
		if [ `arch` != "m68k" ] && type -p m68k-linux-gcc >/dev/null; then \
			inc=`cat /dev/null | m68k-linux-gcc -v -E - 2>&1 | \
			sed -n '/starts here:$$/,/&End of search/s/^ \(\/.*\)/\1/p' | \
			tail -1`/linux/..; \
		fi; \
		$(MAKE) KERNELINC=$$inc; \
		mv bootstrap ataboot; \
		gzip -9c ataboot | uuencode ataboot.gz >debian/ataboot.gz.uue; \
		$(MAKE) clean; \
		$(MAKE) USE_BOOTP=y KERNELINC=$$inc; \
		mv bootstrap ataboot-bootp; \
		gzip -9c ataboot-bootp | uuencode ataboot-bootp.gz >debian/ataboot-bootp.gz.uue; \
		$(MAKE) -f Makefile.rawwrite; \
		gzip -9c rawwrite.ttp | uuencode rawwrite.ttp.gz >debian/rawwrite.ttp.gz.uue; \
	else \
		echo "No cross compiler available -- not rebuilding binaries"; \
		echo "Using prepacked ones instead."; \
		uudecode -o /dev/stdout debian/ataboot.gz.uue | gzip -dc >ataboot; \
		uudecode -o /dev/stdout debian/ataboot-bootp.gz.uue | gzip -dc >ataboot-bootp; \
		uudecode -o /dev/stdout debian/rawwrite.ttp.gz.uue | gzip -dc >rawwrite.ttp; \
		chmod 755 ataboot ataboot-bootp rawwrite.ttp; \
	fi
	touch build

clean:
	$(checkdir)
	rm -f build
	$(MAKE) clean
	$(MAKE) -f Makefile.rawwrite clean
	dh_clean
	rm -f ataboot ataboot-bootp rawwrite.ttp
	rm -f img*Atari
	rm -f `find . -name "*~"`
	rm -rf debian/tmp debian/files* core debian/substvars

binary-indep: build
	$(checkdir)
# There are no architecture-independent files to be uploaded
# generated by this package.  If there were any they would be
# made here.

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs
	install -d $(lib) $(sbin)
	# install bootstraps
	install -m 644 ataboot $(lib)/ataboot.ttp
	install -m 644 ataboot-bootp $(lib)/ataboot-bootp.ttp
	gzip -9f $(lib)/ataboot*
	# install rawwrite.ttp
	install -m 644 rawwrite.ttp $(lib)
	gzip -9f $(lib)/rawwrite.ttp
	# install config script
	install -m 755 atabootconfig $(sbin)
	# build and install boot disk images
	chmod +x ./builddisk
	./builddisk 1440
	./builddisk 720
	install -m 644 img*Atari $(lib)
	gzip -9f $(lib)/img*
	# install README for lib dir
	install -m 644 debian/README.lib $(lib)/README
	dh_installdocs ataboot.txt
	dh_installchangelogs CHANGES
	dh_installmanpages
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	#dh_shlibdeps
	dh_gencontrol
	#dh_du
	dh_md5sums
	dh_builddeb

define checkdir
	test -f bootstrap.c -a -f debian/rules
endef

binary:		binary-indep binary-arch

.PHONY: binary binary-arch binary-indep clean