File: rules

package info (click to toggle)
mol 0.9.70-17
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 6,436 kB
  • ctags: 11,008
  • sloc: ansic: 60,495; asm: 3,306; makefile: 716; yacc: 706; sh: 546; lex: 501; cpp: 370; perl: 228; pascal: 18
file content (144 lines) | stat: -rwxr-xr-x 4,168 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
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
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# This file is public domain software, originally written by Joey Hess. 

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

# This is the debhelper compatibility version to use.
export DH_COMPAT=3

# Debian specific flags to make,, mostly installation directories
DEBIANFLAGS=\
prefix=/usr \
datadir=/usr/share/mol \
libdir=/usr/lib/mol \
docdir=/usr/share/doc/mol

configure: configure-stamp
configure-stamp:
	dh_testdir

# configure the package.
	./autogen.sh
	CFLAGS="$$CFLAGS -D_FILE_OFFSET_BITS=64" ./configure --disable-png
	yes '' | make config

	touch configure-stamp

build: configure build-stamp
build-stamp:
	dh_testdir

# build the Debian specific manpages
	cd debian; for man in mol.7 moldeb.1 molrcget.1 strip_nwrom.1; do docbook-to-man $${man/[17]/sgml} > ../$$man; done

# build the package
	$(MAKE) BUILD_MODS=n NETDRIVER=n $(DEBIANFLAGS)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f configure-stamp build-stamp

# remove the manpages
	rm -f *.[17]

# clean the package, including auto-generated stuff that distclean overlooks
	-$(MAKE) distclean
	rm -f .config.cmd .config.old
	cd src/vconfig; rm -f modes-y.c modes-y.h modes-l.c
	rm -f src/shared/config.h.in
	rm -f src/kmod/mpc107/Makefile src/cpu/mpc107/Makefile src/cpu/ppc/asm_offsets.h
	rm -f mollib/mol.symbols
	cd config/kconfig; rm -rf zconf-y.c zconf-y.h zconf-l.c .autoinclude

# remove the modules source directory and tarball
	rm -rf modules
	rm -f mol-modules.tar.gz

	dh_clean debian/tmp

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

# install the overrides file for lintian
	install -o root -g root -m 644 debian/lintian.overrides `pwd`/debian/mol/usr/share/lintian/overrides/mol

# install the Mac-on-Linux emulator into mol.
	$(MAKE) DESTDIR=`pwd`/debian/mol $(DEBIANFLAGS) install

# get rid of unnecessary absolute links
	rm `pwd`/debian/mol/usr/bin/mol
	ln -sf ../lib/mol/bin/startmol `pwd`/debian/mol/usr/bin
	ln -sf ../lib/mol/bin/molrcget `pwd`/debian/mol/usr/bin

# fix permissions
	chmod 644 `pwd`/debian/mol/usr/lib/mol/mol.symbols

# extract a 32x32 XPM menu logo from the raw boot logo
	convert -depth 8 -size 100x122 -frame 14x3 -mattecolor '#ffffce' -scale 25% rgb:`pwd`/mollib/graphics/bootlogo.raw `pwd`/debian/mol/usr/share/pixmaps/mol.xpm

# put together the mol-modules-source package by copying the relevant code
	mkdir -p modules/mol/src modules/mol/scripts
	cp -pr src/kmod src/netdriver src/shared src/include modules/mol/src
	cp -pr scripts/kernelsrc scripts/mol_uname modules/mol/scripts
	cp -pr Makefile.top Rules.make config .config .inc-ppc modules/mol

# add the Debian directory and the top-level Makefile
	cp -pr debian/debian.mol-modules-source modules/mol/debian
	cp -p debian/Makefile.mol-modules-source modules/mol/Makefile

# set correct permissions
	chmod u+x modules/mol/debian/rules
	chown -R root.src modules
	chmod -R u+w,go-w,a+rX modules

# create a tarball
	tar zcf mol-modules.tar.gz modules

# install the source tarball into mol-modules-source
	install -o root -g root -m 644 mol-modules.tar.gz `pwd`/debian/mol-modules-source/usr/src

# create the mol-modules packages by moving the installed modules
	dh_movefiles --sourcedir=debian/mol
# remove the now empty directory
	rm -rf `pwd`/debian/mol/lib

# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installdebconf	
	dh_installdocs
	dh_installexamples
	dh_installman mol.7 moldeb.1 molrcget.1 strip_nwrom.1
	dh_installman Doc/man/molrc.5 Doc/man/molvconfig.1 Doc/man/startmol.1
	dh_installmenu
	dh_installmodules
	dh_installchangelogs
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps -Xlib/modules
	dh_gencontrol
	dh_md5sums
	dh_builddeb

# Any other binary targets build just one binary package at a time.
binary-%: build install
        make -f debian/rules binary-common DH_OPTIONS=-p$*

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