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/$(paket).build sync
20         debian/$(paket).build
21         # Build succeeded
22
23 pack: $(PACK)
24         # packing succeeded
25
26 # Bauen der kompilierten architekturabhängigen Programme aus den Quellen im Bauverzeichnis
27 build-arch:
28
29 # Bauen der architekturunabhängigen formatierten Dokumente aus den Quellen im Bauverzeichnis
30 build-indep:
31
32 # 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)
33 install: 
34
35 # Erstellen aller Binärpakete (effektiv ist dies die Kombination der binary-arch- und binary-indep-Ziele)
36 binary: binary-arch binary-indep 
37
38 # Erstellen Architektur-abhängiger (Architecture: any) Binärpakete im übergeordneten Verzeichnis
39 binary-arch:
40
41 # Erstellen Architektur-unabhängiger (Architecture: all) Binärpakete im übergeordneten Verzeichnis
42 binary-indep: copy ../$(paket)_$(version)-$(build)$(_arch).deb
43
44 version: $(TARGET)
45         $(INSERT_BUILD) $(TARGET) $(build)
46
47 ../build:
48         mkdir ../build
49
50 sync:
51         bash -c 'for dirs in $$(ls); do rsync -av $$dirs ../build; done'
52
53 copy: debian/$(paket).cp
54         debian/$(paket).cp debian/tmp
55
56 ../$(paket)_$(version)-$(build)$(_arch).deb:debian/tmp/DEBIAN/control $(add_inst_tgt)
57         $(DEB)
58         mv debian/tmp.deb ../$(paket)_$(version)-$(build)$(_arch).deb
59
60 debian/tmp/DEBIAN/control: debian/control debian/changelog
61         dpkg-gencontrol
62
63 debian/changelog: debian/$(paket).changelog debian/setenv.sh
64         sed "s/%BUILD%/$(build)/" debian/$(paket).changelog > debian/changelog
65 #       echo "${pwd} (${build}) unstable; urgency=medium" > debian/changelog
66 #       echo "  * generated by mbuild" >> debian/changelog
67 #       echo " -- Michael Wagner <info@wagnertech.de>  Sun, 11 Feb 2018 20:03:04 +0100" >> debian/changelog
68 #       mb_create_changelog
69
70 debian/tmp/DEBIAN/preinst: debian/$(paket).preinst
71         cp debian/$(paket).preinst debian/tmp/DEBIAN/preinst
72
73 debian/tmp/DEBIAN/postinst: debian/$(paket).postinst
74         cp debian/$(paket).postinst debian/tmp/DEBIAN/postinst
75
76 debian/tmp/DEBIAN/prerm: debian/$(paket).prerm
77         cp debian/$(paket).prerm debian/tmp/DEBIAN/prerm
78
79 debian/tmp/DEBIAN/postrm: debian/$(paket).postrm
80         cp debian/$(paket).postrm debian/tmp/DEBIAN/postrm
81
82 # Load project specification
83 -include rules.post
84
85 # if debian/control is missing, try old mbuild way
86 #debian/control:
87 #       if [ -e  debian/$(paket).control ]; then echo "trallala"; fi
88