Debian Codegraph @

Makefile

raw
1 #
2 # Maintenance Scripts
3 #
4 # This Makefile contains a random selection of targets for easy development.
5 # They mostly serve as example how most of the build/test infrastructure is
6 # used. Feel free to adjust them to your needs.
7 #
8
9 # Enforce bash with fatal errors.
10 SHELL := /bin/bash -eo pipefail
11
12 # Keep intermediates around on failures for better caching.
13 .SECONDARY:
14
15 # Default build and source directories.
16 BUILDDIR ?= ./build
17 SRCDIR ?= .
18
19 #
20 # Target: help
21 #
22
23 .PHONY: help
24 help:
25 @# 80-width marker:
26 @# 01234567012345670123456701234567012345670123456701234567012345670123456701234567
27 @echo "make [TARGETS...]"
28 @echo
29 @echo "The following targets are provided by this maintenance makefile:"
30 @echo
31 @echo " help: Print this usage information"
32 @echo
33 @echo " release-fedora: Print checklist for Fedora releases"
34 @echo " release-github: Print checklist for Github releases"
35 @echo
36 @echo " meson-build: Build the Meson-based project"
37 @echo " meson-setup: Reconfigure the Meson setup"
38 @echo " meson-test: Run the Meson-based test suite"
39 @echo
40 @echo " system-build: Build system test-image"
41 @echo " system-run: Run system test-image"
42
43 #
44 # Target: BUILDDIR
45 #
46
47 $(BUILDDIR)/:
48 mkdir -p "$@"
49
50 $(BUILDDIR)/%/:
51 mkdir -p "$@"
52
53 #
54 # Target: FORCE
55 #
56 # Used as alternative to `.PHONY` if the target is not fixed.
57 #
58
59 .PHONY: FORCE
60 FORCE:
61
62 #
63 # Target: meson-*
64 #
65
66 MESON_SETUP = \
67 meson \
68 setup \
69 --buildtype "debugoptimized" \
70 --reconfigure \
71 --warnlevel "2" \
72 -D "docs=true" \
73 -D "launcher=true" \
74 -- \
75 $(BUILDDIR)/meson \
76 $(SRCDIR)
77
78 $(BUILDDIR)/meson/: | $(BUILDDIR)/
79 $(MESON_SETUP)
80
81 .PHONY: meson-build
82 meson-build: $(BUILDDIR)/meson/
83 meson \
84 compile \
85 -C "$(BUILDDIR)/meson/"
86
87 .PHONY: meson-setup
88 meson-setup: | $(BUILDDIR)/
89 $(MESON_SETUP)
90
91 .PHONY: meson-setup
92 meson-setup-32: | $(BUILDDIR)/
93 CFLAGS="-m32" \
94 PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig:/usr/share/pkgconfig" \
95 RUSTFLAGS="--target i686-unknown-linux" \
96 $(MESON_SETUP)
97
98 .PHONY: meson-test
99 meson-test: $(BUILDDIR)/meson/
100 meson \
101 test \
102 --print-errorlogs \
103 -C "$(BUILDDIR)/meson/"
104
105 #
106 # Target: release-*
107 #
108
109 VNEXT=2
110 VPREV="$$((${VNEXT} - 1))"
111
112 .PHONY: release-fedora
113 release-fedora:
114 @echo "Checklist for Fedora releases (for each branch):"
115 @echo
116 @echo " * Fetch Kerberos ticket:"
117 @echo " kinit <fas>@FEDORAPROJECT.ORG"
118 @echo
119 @echo " * Edit and Update dbus-broker.spec"
120 @echo
121 @echo " * Pull new sources:"
122 @echo " curl -O dbus-broker-${VNEXT}.tar.xz https://github.com/bus1/dbus-broker/releases/download/v${VNEXT}/dbus-broker-${VNEXT}.tar.xz"
123 @echo " * Push new sources:"
124 @echo " fedpkg new-sources dbus-broker-${VNEXT}.tar.xz"
125 @echo
126 @echo " * Commit and push at least once"
127 @echo
128 @echo " * Submit build to Koji:"
129 @echo " fedpkg build"
130 @echo
131 @echo " * Submit update to Bodhi"
132 @echo
133
134 .PHONY: release-github
135 release-github:
136 @echo "Checklist for release of dbus-broker-${VNEXT}:"
137 @echo
138 @echo " * Update subprojects via:"
139 @echo " meson subprojects update"
140 @echo " * Fill in NEWS via:"
141 @echo " git log v${VPREV}..HEAD"
142 @echo " * List contributors in NEWS via:"
143 @echo " git log --format='%an, ' v${VPREV}..HEAD | sort -u | tr -d '\n'"
144 @echo " * Bump project.version in ./meson.build"
145 @echo
146 @echo " * Commit and push at least once"
147 @echo
148 @echo " * Tag 'v${VNEXT}' with content 'dbus-broker ${VNEXT}' via:"
149 @echo " git tag -s -m 'dbus-broker ${VNEXT}' v${VNEXT} HEAD"
150 @echo " * Create tarball via: (VERIFY YOU HAVE v${VNEXT} CHECKED OUT!)"
151 @echo " meson dist -C build --include-subprojects"
152 @echo " * Sign tarball via:"
153 @echo " gpg --armor --detach-sign \"./build/meson-dist/dbus-broker-${VNEXT}.tar.xz\""
154 @echo
155 @echo " * Push tag via:"
156 @echo " git push <remote> v${VNEXT}"
157 @echo " * Upload tarball to github via custom release"
158 @echo
159
160 #
161 # Target: system-*
162 #
163
164 .PHONY: system-build
165 system-build:
166 podman \
167 build \
168 --file "$(SRCDIR)/test/image/dbrk-fedora.Dockerfile" \
169 --tag "dbrk-fedora" \
170 -- \
171 "$(SRCDIR)"
172
173 .PHONY: system-run
174 system-run:
175 podman \
176 run \
177 --interactive \
178 --rm \
179 --tty \
180 "dbrk-fedora"