aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2024-02-24 19:58:22 +0100
committerMattias Andrée <maandree@kth.se>2024-02-24 19:58:22 +0100
commit39ca33807b936a46bbd491ab5ecff817a6a28144 (patch)
treedec4c1bfc788fa6efa242fd6398e9c4f080b6999 /Makefile
parentFirst commit (diff)
downloadcoreupdown-39ca33807b936a46bbd491ab5ecff817a6a28144.tar.gz
coreupdown-39ca33807b936a46bbd491ab5ecff817a6a28144.tar.bz2
coreupdown-39ca33807b936a46bbd491ab5ecff817a6a28144.tar.xz
Add coreupdownd
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index f0d383d..f9850e0 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,16 @@
CONFIGFILE = config.mk
include $(CONFIGFILE)
+CPPFLAGS_CONFS =\
+ -D'COREUP_THRESHOLD_CPU=$(COREUP_THRESHOLD_CPU)'\
+ -D'COREUP_THRESHOLD_TIME=$(COREUP_THRESHOLD_TIME)'\
+ -D'COREUP_COOLDOWN=$(COREUP_COOLDOWN)'\
+ -D'COREDOWN_THRESHOLD_CPU=$(COREDOWN_THRESHOLD_CPU)'\
+ -D'COREDOWN_THRESHOLD_TIME=$(COREDOWN_THRESHOLD_TIME)'\
+ -D'COREDOWN_COOLDOWN=$(COREDOWN_COOLDOWN)'\
+ -D'DAEMON_INTERVAL_SEC=$(DAEMON_INTERVAL_SEC)'\
+ -D'DAEMON_INTERVAL_NSEC=$(DAEMON_INTERVAL_NSEC)'
+
OBJ =\
coreupdown.o
@@ -12,7 +22,7 @@ all: coreupdown
$(OBJ): $(HDR)
.c.o:
- $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) $(CPPFLAGS_CONFS)
coreupdown: $(OBJ)
$(CC) -o $@ $(OBJ) $(LDFLAGS)
@@ -22,9 +32,11 @@ install: coreupdown
mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1"
test -f "$(DESTDIR)$(PREFIX)/bin/coreup" || test ! -e "$(DESTDIR)$(PREFIX)/bin/coreup"
test -f "$(DESTDIR)$(PREFIX)/bin/coredown" || test ! -e "$(DESTDIR)$(PREFIX)/bin/coredown"
+ test -f "$(DESTDIR)$(PREFIX)/bin/coreupdownd" || test ! -e "$(DESTDIR)$(PREFIX)/bin/coreupdownd"
cp -- coreupdown "$(DESTDIR)$(PREFIX)/bin/coreup"
- ln -sf coreup "$(DESTDIR)$(PREFIX)/bin/coredown"
- cp -- coreup.1 coredown.1 "$(DESTDIR)$(MANPREFIX)/man1"
+ ln -sf -- coreup "$(DESTDIR)$(PREFIX)/bin/coredown"
+ ln -sf -- coreup "$(DESTDIR)$(PREFIX)/bin/coreupdownd"
+ cp -- coreup.1 coredown.1 coreupdownd.1 "$(DESTDIR)$(MANPREFIX)/man1"
postinstall:
chown '0:0' "$(DESTDIR)$(PREFIX)/bin/coreup"
@@ -33,8 +45,10 @@ postinstall:
uninstall:
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/coreup"
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/coredown"
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/coreupdownd"
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/coreup.1"
-rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/coredown.1"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/coreupdownd.1"
clean:
-rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch *.gcov *.gcno *.gcda