-
Notifications
You must be signed in to change notification settings - Fork 84
/
Makefile
174 lines (151 loc) · 3.94 KB
/
Makefile
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#
# Maintenance Scripts
#
# This Makefile contains a random selection of targets for easy development.
# They mostly serve as example how most of the build/test infrastructure is
# used. Feel free to adjust them to your needs.
#
# Enforce bash with fatal errors.
SHELL := /bin/bash -eo pipefail
# Keep intermediates around on failures for better caching.
.SECONDARY:
# Default build and source directories.
BUILDDIR ?= ./build
SRCDIR ?= .
#
# Target: help
#
.PHONY: help
help:
@# 80-width marker:
@# 01234567012345670123456701234567012345670123456701234567012345670123456701234567
@echo "make [TARGETS...]"
@echo
@echo "The following targets are provided by this maintenance makefile:"
@echo
@echo " help: Print this usage information"
@echo
@echo " release-fedora: Print checklist for Fedora releases"
@echo " release-github: Print checklist for Github releases"
@echo
@echo " meson-build: Build the Meson-based project"
@echo " meson-setup: Reconfigure the Meson setup"
@echo " meson-test: Run the Meson-based test suite"
@echo
@echo " system-build: Build system test-image"
@echo " system-run: Run system test-image"
#
# Target: BUILDDIR
#
$(BUILDDIR)/:
mkdir -p "$@"
$(BUILDDIR)/%/:
mkdir -p "$@"
#
# Target: FORCE
#
# Used as alternative to `.PHONY` if the target is not fixed.
#
.PHONY: FORCE
FORCE:
#
# Target: meson-*
#
MESON_SETUP = \
meson \
setup \
--buildtype "debugoptimized" \
--reconfigure \
--warnlevel "2" \
-D "audit=true" \
-D "docs=true" \
-D "launcher=true" \
-- \
$(BUILDDIR)/meson \
$(SRCDIR)
$(BUILDDIR)/meson/: | $(BUILDDIR)/
$(MESON_SETUP)
.PHONY: meson-build
meson-build: $(BUILDDIR)/meson/
meson \
compile \
-C "$(BUILDDIR)/meson/"
.PHONY: meson-setup
meson-setup: | $(BUILDDIR)/
$(MESON_SETUP)
.PHONY: meson-test
meson-test: $(BUILDDIR)/meson/
meson \
test \
--print-errorlogs \
-C "$(BUILDDIR)/meson/"
#
# Target: release-*
#
VNEXT=2
VPREV="$$((${VNEXT} - 1))"
.PHONY: release-fedora
release-fedora:
@echo "Checklist for Fedora releases (for each branch):"
@echo
@echo " * Fetch Kerberos ticket:"
@echo " kinit <fas>@FEDORAPROJECT.ORG"
@echo
@echo " * Edit and Update dbus-broker.spec"
@echo
@echo " * Pull new sources:"
@echo " curl -O dbus-broker-${VNEXT}.tar.xz https://github.com/bus1/dbus-broker/releases/download/v${VNEXT}/dbus-broker-${VNEXT}.tar.xz"
@echo " * Push new sources:"
@echo " fedpkg new-sources dbus-broker-${VNEXT}.tar.xz"
@echo
@echo " * Commit and push at least once"
@echo
@echo " * Submit build to Koji:"
@echo " fedpkg build"
@echo
@echo " * Submit update to Bodhi"
@echo
.PHONY: release-github
release-github:
@echo "Checklist for release of dbus-broker-${VNEXT}:"
@echo
@echo " * Update subprojects via:"
@echo " meson subprojects update"
@echo " * Fill in NEWS via:"
@echo " git log v${VPREV}..HEAD"
@echo " * List contributors in NEWS via:"
@echo " git log --format='%an, ' v${VPREV}..HEAD | sort -u | tr -d '\n'"
@echo " * Bump project.version in ./meson.build"
@echo
@echo " * Commit and push at least once"
@echo
@echo " * Tag 'v${VNEXT}' with content 'dbus-broker ${VNEXT}' via:"
@echo " git tag -s -m 'dbus-broker ${VNEXT}' v${VNEXT} HEAD"
@echo " * Create tarball via: (VERIFY YOU HAVE v${VNEXT} CHECKED OUT!)"
@echo " meson dist -C build --include-subprojects"
@echo " * Sign tarball via:"
@echo " gpg --armor --detach-sign \"./build/meson-dist/dbus-broker-${VNEXT}.tar.xz\""
@echo
@echo " * Push tag via:"
@echo " git push <remote> v${VNEXT}"
@echo " * Upload tarball to github via custom release"
@echo
#
# Target: system-*
#
.PHONY: system-build
system-build:
podman \
build \
--file "$(SRCDIR)/test/image/dbrk-fedora.Dockerfile" \
--tag "dbrk-fedora" \
-- \
"$(SRCDIR)"
.PHONY: system-run
system-run:
podman \
run \
--interactive \
--rm \
--tty \
"dbrk-fedora"