33
44include config.mk
55
6- VERSION := "1.11 .0-non-git"
6+ VERSION := "1.12 .0-non-git"
77ifneq ($(wildcard ./.git/) ,)
88VERSION := $(shell ${GIT} describe --tags 2>/dev/null || echo ${VERSION})
99endif
@@ -29,14 +29,20 @@ endif
2929
3030SYSCONF_FORCE_NEW ?= $(shell [ -f ${DESTDIR}${SYSCONFFILE} ] || echo 1)
3131
32- CFLAGS := ${DEFAULT_CPPFLAGS} ${CPPFLAGS} ${DEFAULT_CFLAGS} ${CFLAGS} ${INCS} -MMD -MP
33- LDFLAGS := ${DEFAULT_LDFLAGS} ${LDFLAGS} ${LIBS}
32+ ifneq (0,${DUNSTIFY})
33+ DUNSTIFY_CFLAGS := ${DEFAULT_CFLAGS} ${CFLAGS} ${CPPFLAGS} $(shell $(PKG_CONFIG ) --cflags libnotify)
34+ DUNSTIFY_LDFLAGS := ${DEFAULT_LDFLAGS} ${LDFLAGS} $(shell $(PKG_CONFIG ) --libs libnotify)
35+ endif
36+
37+ CPPFLAGS := ${DEFAULT_CPPFLAGS} ${CPPFLAGS}
38+ CFLAGS := ${DEFAULT_CFLAGS} ${CFLAGS} ${INCS} -MMD -MP
39+ LDFLAGS := ${DEFAULT_LDFLAGS} ${LDFLAGS} ${LIBS}
3440
3541SRC := $(sort $(shell ${FIND} src/ ! \( -path src/wayland -prune -o -path src/x11 -prune \) -name '* .c') )
3642
3743ifneq (0,${WAYLAND})
3844# with Wayland support
39- CFLAGS += -DHAVE_WL_CURSOR_SHAPE -DHAVE_WL_EXT_IDLE_NOTIFY
45+ CPPFLAGS += -DHAVE_WL_CURSOR_SHAPE -DHAVE_WL_EXT_IDLE_NOTIFY
4046SRC += $(sort $(shell ${FIND} src/wayland -name '* .c') )
4147endif
4248
@@ -59,35 +65,39 @@ DEPS := ${SRC:.c=.d} ${TEST_SRC:.c=.d}
5965.PHONY : all debug
6066all : doc dunst service
6167
62- debug : CFLAGS += ${CPPFLAGS_DEBUG} ${CFLAGS_DEBUG}
63- debug : LDFLAGS += ${LDFLAGS_DEBUG}
6468debug : CPPFLAGS += ${CPPFLAGS_DEBUG}
69+ debug : CFLAGS += ${CFLAGS_DEBUG}
70+ debug : LDFLAGS += ${LDFLAGS_DEBUG}
6571debug : all
6672
6773-include $(DEPS )
6874
6975${OBJ} ${TEST_OBJ} : Makefile config.mk
7076
77+ src/dunst.o : src/dunst.c
78+ ${CC} -o $@ -c $< ${CPPFLAGS} ${CFLAGS} \
79+ -D_CCDATE=" $( shell date ' +%Y-%m-%d' ) " -D_CFLAGS=" $( filter-out $( filter -I%,${INCS} ) ,${CFLAGS} ) " -D_LDFLAGS=" ${LDFLAGS} "
80+
7181% .o : % .c
72- ${CC} -o $@ -c $< ${CFLAGS}
82+ ${CC} -o $@ -c $< ${CPPFLAGS} ${ CFLAGS}
7383
7484dunst : ${OBJ} main.o
7585 ${CC} -o ${@ } ${OBJ} main.o ${CFLAGS} ${LDFLAGS}
7686
7787ifneq (0,${DUNSTIFY})
7888all : dunstify
7989dunstify : dunstify.o
80- ${CC} -o ${@ } dunstify.o ${CFLAGS } ${LDFLAGS }
90+ ${CC} -o ${@ } dunstify.o ${DUNSTIFY_CFLAGS } ${DUNSTIFY_LDFLAGS }
8191endif
8292
83- .PHONY : test test-valgrind test-coverage
93+ .PHONY : test test-valgrind test-coverage functional-tests
8494test : test/test clean-coverage-run
8595 # Make sure an error code is returned when the test fails
8696 /usr/bin/env bash -c ' set -euo pipefail;\
87- ./test/test -v | ./test/greenest.awk '
97+ TESTDIR=./test ./test/test -v | ./test/greenest.awk '
8898
8999test-valgrind : test/test
90- ${VALGRIND} \
100+ TESTDIR=./test ${VALGRIND} \
91101 --suppressions=.valgrind.suppressions \
92102 --track-origins=yes \
93103 --leak-check=full \
@@ -110,13 +120,16 @@ test-coverage-report: test-coverage
110120 -o docs/internal/coverage/index.html
111121
112122test/% .o : test/% .c src/% .c
113- ${CC} -o $@ -c $< ${CFLAGS}
123+ ${CC} -o $@ -c $< ${CFLAGS} ${CPPFLAGS}
114124
115125test/test : ${OBJ} ${TEST_OBJ}
116126 ${CC} -o ${@ } ${TEST_OBJ} $(filter-out ${TEST_OBJ:test/% =src/% },${OBJ}) ${CFLAGS} ${LDFLAGS}
117127
128+ functional-tests : dunst dunstify
129+ PREFIX=. ./test/functional-tests/test.sh
130+
118131.PHONY : doc doc-doxygen
119- doc : docs/dunst.1 docs/dunst.5 docs/dunstctl.1
132+ doc : docs/dunst.1 docs/dunst.5 docs/dunstctl.1 docs/dunstify.1
120133
121134# Can't dedup this as we need to explicitly provide the name and title text to
122135# pod2man :(
@@ -126,6 +139,8 @@ docs/dunst.5: docs/dunst.5.pod
126139 ${POD2MAN} --name=dunst -c " Dunst Reference" --section=5 --release=${VERSION} $< > $@
127140docs/dunstctl.1 : docs/dunstctl.pod
128141 ${POD2MAN} --name=dunstctl -c " dunstctl reference" --section=1 --release=${VERSION} $< > $@
142+ docs/dunstify.1 : docs/dunstify.pod
143+ ${POD2MAN} --name=dunstify -c " dunstify reference" --section=1 --release=${VERSION} $< > $@
129144
130145doc-doxygen :
131146 ${DOXYGEN} docs/internal/Doxyfile
@@ -183,6 +198,7 @@ clean-doc:
183198 rm -f docs/dunst.1
184199 rm -f docs/dunst.5
185200 rm -f docs/dunstctl.1
201+ rm -f docs/dunstify.1
186202 rm -fr docs/internal/html
187203 rm -fr docs/internal/coverage
188204
@@ -204,14 +220,15 @@ clean-wayland-protocols:
204220 install-service install-service-dbus install-service-systemd \
205221 uninstall uninstall-dunstctl uninstall-dunstrc \
206222 uninstall-service uninstall-service-dbus uninstall-service-systemd \
207- uninstall-keepconf uninstall-purge
223+ uninstall-keepconf uninstall-purge
208224install : install-dunst install-dunstctl install-dunstrc install-service
209225
210226install-dunst : dunst doc
211227 install -Dm755 dunst ${DESTDIR}${BINDIR} /dunst
212228 install -Dm644 docs/dunst.1 ${DESTDIR}${MANPREFIX} /man1/dunst.1
213229 install -Dm644 docs/dunst.5 ${DESTDIR}${MANPREFIX} /man5/dunst.5
214230 install -Dm644 docs/dunstctl.1 ${DESTDIR}${MANPREFIX} /man1/dunstctl.1
231+ install -Dm644 docs/dunstify.1 ${DESTDIR}${MANPREFIX} /man1/dunstify.1
215232
216233install-dunstctl : dunstctl
217234 install -Dm755 dunstctl ${DESTDIR}${BINDIR} /dunstctl
@@ -243,13 +260,13 @@ install-completions:
243260 install -Dm644 completions/dunstctl.bashcomp ${DESTDIR}${BASHCOMPLETIONDIR} /dunstctl
244261 install -Dm644 completions/_dunst.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR} /_dunst
245262 install -Dm644 completions/_dunstctl.zshcomp ${DESTDIR}${ZSHCOMPLETIONDIR} /_dunstctl
246- install -Dm644 completions/dunst.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR} /dunst
247- install -Dm644 completions/dunstctl.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR} /dunstctl
263+ install -Dm644 completions/dunst.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR} /dunst.fish
264+ install -Dm644 completions/dunstctl.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR} /dunstctl.fish
248265
249266ifneq (0,${DUNSTIFY})
250267install : install-completions-dunstify
251268install-completions-dunstify :
252- install -Dm644 completions/dunstify.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR} /dunstify
269+ install -Dm644 completions/dunstify.fishcomp ${DESTDIR}${FISHCOMPLETIONDIR} /dunstify.fish
253270endif
254271endif
255272
@@ -261,6 +278,7 @@ uninstall-keepconf: uninstall-service uninstall-dunstctl uninstall-completions
261278 rm -f ${DESTDIR}${MANPREFIX} /man1/dunst.1
262279 rm -f ${DESTDIR}${MANPREFIX} /man5/dunst.5
263280 rm -f ${DESTDIR}${MANPREFIX} /man1/dunstctl.1
281+ rm -f ${DESTDIR}${MANPREFIX} /man1/dunstify.1
264282
265283uninstall-dunstrc :
266284 rm -f ${DESTDIR}${SYSCONFFILE}
@@ -284,6 +302,6 @@ uninstall-completions:
284302 rm -f ${DESTDIR}${BASHCOMPLETIONDIR} /dunstctl
285303 rm -f ${DESTDIR}${ZSHCOMPLETIONDIR} /_dunst
286304 rm -f ${DESTDIR}${ZSHCOMPLETIONDIR} /_dunstctl
287- rm -f ${DESTDIR}${FISHCOMPLETIONDIR} /dunst
288- rm -f ${DESTDIR}${FISHCOMPLETIONDIR} /dunstctl
289- rm -f ${DESTDIR}${FISHCOMPLETIONDIR} /dunstify
305+ rm -f ${DESTDIR}${FISHCOMPLETIONDIR} /dunst.fish
306+ rm -f ${DESTDIR}${FISHCOMPLETIONDIR} /dunstctl.fish
307+ rm -f ${DESTDIR}${FISHCOMPLETIONDIR} /dunstify.fish
0 commit comments