]> wagnertech.de Git - projects.git/blob - tools/make/rules
posaune
[projects.git] / tools / make / rules
1 #!/usr/bin/make -f
2
3 # Generic rules for mBuild build process
4
5 # defile default operations
6 NOP = @echo "No operation for target $@"
7 DEB = fakeroot dpkg-deb --build debian/tmp
8
9 include debian/rules.pre
10
11 default:
12         echo "no default rule available"
13
14 # Löschen aller kompilierten, erzeugten und nicht benötigten Dateien im Bauverzeichnis
15 clean:
16         -rm -rf debian/tmp
17
18 # Bauen der kompilierten Programme und formatierten Dokumente aus den Quellen im Bauverzeichnis
19 build: debian/build.sh sync
20         debian/build.sh
21         # Build succeeded
22
23 # Bauen der kompilierten architekturabhängigen Programme aus den Quellen im Bauverzeichnis
24 build-arch:
25
26 # Bauen der architekturunabhängigen formatierten Dokumente aus den Quellen im Bauverzeichnis
27 build-indep:
28
29 # Installieren der Dateien in einen Verzeichnisbaum unterhalb des Verzeichnisses debian für jedes Binärpaket. Falls sie festgelegt wurden, hängen binary*-Ziele effektiv von diesem Ziel ab (optional)
30 install: 
31
32 # Erstellen aller Binärpakete (effektiv ist dies die Kombination der binary-arch- und binary-indep-Ziele)
33 binary: binary-arch binary-indep 
34
35 # Erstellen Architektur-abhängiger (Architecture: any) Binärpakete im übergeordneten Verzeichnis
36 binary-arch:
37
38 # Erstellen Architektur-unabhängiger (Architecture: all) Binärpakete im übergeordneten Verzeichnis
39 binary-indep: copy ../$(paket)_$(version)-$(build)$(_arch).deb
40
41 ../build:
42         mkdir ../build
43
44 sync:
45         bash -c 'for dirs in $$(ls); do rsync -av $$dirs ../build; done'
46
47 copy: debian/$(paket).cp
48         debian/$(paket).cp debian/tmp
49
50 ../$(paket)_$(version)-$(build)$(_arch).deb:debian/tmp/DEBIAN/control $(add_inst_tgt)
51         $(DEB)
52         mv debian/tmp.deb ../$(paket)_$(version)-$(build)$(_arch).deb
53
54 debian/tmp/DEBIAN/control: debian/control debian/changelog
55         dpkg-gencontrol
56
57 debian/changelog: debian/$(paket).changelog debian/setenv.sh
58         sed "s/%BUILD%/$(build)/" debian/$(paket).changelog > debian/changelog
59 #       echo "${pwd} (${build}) unstable; urgency=medium" > debian/changelog
60 #       echo "  * generated by mbuild" >> debian/changelog
61 #       echo " -- Michael Wagner <info@wagnertech.de>  Sun, 11 Feb 2018 20:03:04 +0100" >> debian/changelog
62 #       mb_create_changelog
63
64 debian/tmp/DEBIAN/preinst: debian/$(paket).preinst
65         cp debian/$(paket).preinst debian/tmp/DEBIAN/preinst
66
67 debian/tmp/DEBIAN/postinst: debian/$(paket).postinst
68         cp debian/$(paket).postinst debian/tmp/DEBIAN/postinst
69
70 debian/tmp/DEBIAN/prerm: debian/$(paket).prerm
71         cp debian/$(paket).prerm debian/tmp/DEBIAN/prerm
72
73 debian/tmp/DEBIAN/postrm: debian/$(paket).postrm
74         cp debian/$(paket).postrm debian/tmp/DEBIAN/postrm
75
76 # Load project specification
77 -include rules.post
78
79 # if debian/control is missing, try old mbuild way
80 #debian/control:
81 #       if [ -e  debian/$(paket).control ]; then echo "trallala"; fi
82