diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -11,18 +11,31 @@ SH = alarm backlight bell ccgp cfg chmodef curlqb dateft dirnameall gita gitfork PACMAN_HOOKS = setcap-intel_gpu_top.hook setcap-iotop-c.hook setcap-nethogs.hook PREFIX = /usr/local -install: +all: dynotify + +dynotify: dynotify.c +# https://stackoverflow.com/q/28533059 +# https://stackoverflow.com/q/3220277 + cc -Wall $$(pkg-config --cflags --libs libnotify libcurl json-c) -o $@ $< + +clean: + rm -f dynotify + +# I think `install: all` makes make all first, since all is `all: dynotify`, it will make dynotify first, then install all +install: all mkdir -p ${DESTDIR}${PREFIX}/bin # Another way would be define and use INSTALL INSTALL_PROGRAM INSTALL_DATA instead of use `cp -f` or `install` directly, see `info make` for i in ${SH}; do cp -f sh/$$i ${DESTDIR}${PREFIX}/bin; done mkdir -p ${DESTDIR}${PREFIX}/share/libalpm/hooks # /usr/local/share/libalpm/hooks default does not work, need to change pacman.conf for i in ${PACMAN_HOOKS}; do cp -f pacman_hooks/$$i ${DESTDIR}${PREFIX}/share/libalpm/hooks; done + cp -f dynotify ${DESTDIR}${PREFIX}/bin uninstall: for i in ${SH}; do rm -f ${DESTDIR}${PREFIX}/bin/$$i; done for i in ${PACMAN_HOOKS}; do rm -f ${DESTDIR}${PREFIX}/share/libalpm/hooks/$$i; done # RM is default to `rm -f`, see `info make` # for i in ${SH}; do ${RM} ${DESTDIR}${PREFIX}/bin/$$i; done + rm -f ${DESTDIR}${PREFIX}/bin/dynotify -.PHONY: install uninstall +.PHONY: all clean install uninstall |