forked from bus1/dbus-broker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (116 loc) · 3.13 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
#
# 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.
#
#
# The gcc warning-sets -Wall and -Wextra enable some annoying warnings, which
# we really do not care about. Disable them here. Additionally, add some
# warnings that we consider mandatory for our code-base.
#
MYCFLAGS= \
-Wno-unused-parameter \
-Wno-maybe-uninitialized \
-Wno-pointer-arith \
-Wno-unknown-warning-option \
\
-Wundef \
-Wlogical-op \
-Wmissing-include-dirs \
-Wold-style-definition \
-Wdeclaration-after-statement \
-Wfloat-equal \
-Wsuggest-attribute=noreturn \
-Wstrict-prototypes \
-Wredundant-decls \
-Wmissing-noreturn \
-Wshadow \
-Wendif-labels \
-Wstrict-aliasing=3 \
-Wwrite-strings \
-Wdate-time \
-Wnested-externs \
-Werror=overflow \
-Werror=missing-prototypes \
-Werror=implicit-function-declaration \
-Werror=missing-declarations \
-Werror=return-type \
-Werror=incompatible-pointer-types
BUILDDIR?="$$PWD/mybuild"
all:
@echo "Available targets:"
@echo " meson: Generate build files via meson"
@echo " ninja: Build project via ninja"
@echo " test: Run test suite via ninja"
@echo " osi: Build test-container via mkosi"
@echo " run: Run test-container via nspawn"
@echo "release: Print checklist for releases"
.PHONY: all
meson:
rm -Rf ${BUILDDIR}
CFLAGS="${MYCFLAGS} $$CFLAGS" \
meson \
${BUILDDIR} \
--prefix /usr \
--buildtype debugoptimized \
--warnlevel 2 \
-Dlauncher=false \
${MESONFLAGS}
.PHONY: meson
ninja:
ninja \
-C ${BUILDDIR} \
${NINJAFLAGS}
.PHONY: ninja
docs:
mkdir -p ${BUILDDIR}/docs
rst2man docs/dbus-broker-launch.rst ${BUILDDIR}/docs/dbus-broker-launch.1
rst2man docs/dbus-broker.rst ${BUILDDIR}/docs/dbus-broker.1
.PHONY: docs
test:
ninja \
-C ${BUILDDIR} \
${NINJAFLAGS} \
test
.PHONY: test
osi:
mkosi \
-C test/osi/ \
--build-sources "../../" \
--force
.PHONY: osi
run:
systemd-nspawn \
-b \
-D test/osi/rootfs/ \
--bind-ro "${BUILDDIR}/src/dbus-broker:/usr/bin/dbus-broker" \
--bind-ro "${BUILDDIR}/src/dbus-broker-launch:/usr/bin/dbus-broker-launch"
.PHONY: run
VNEXT=2
VPREV="$$((${VNEXT} - 1))"
release:
@echo "Checklist for release of dbus-broker-${VNEXT}:"
@echo
@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 " git archive-all -v --prefix dbus-broker-${VNEXT}/ dbus-broker-${VNEXT}.tar"
@echo " xz dbus-broker-${VNEXT}.tar"
@echo
@echo " * Build and test tarball"
@echo
@echo " * Push tag via:"
@echo " git push <remote> v${VNEXT}"
@echo " * Upload tarball to github via custom release"
@echo
.PHONY: release