summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-05-28 00:57:11 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-05-28 00:57:11 -0700
commit76d8c19870ae727dc2ac88dd5ab19818cc03d3e6 (patch)
tree47deac96df114278811b71e8f37a163651a63e93 /Makefile
parent28507c5f644e7b4737a389577dbd5a7443f538f9 (diff)
add dynotify
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 5497c1f..2c6a0bb 100644
--- a/Makefile
+++ b/Makefile
@@ -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