diff options
Diffstat (limited to '')
-rw-r--r-- | Makefile | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f0d383d --- /dev/null +++ b/Makefile @@ -0,0 +1,46 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OBJ =\ + coreupdown.o + +HDR = + +all: coreupdown +$(OBJ): $(HDR) + +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +coreupdown: $(OBJ) + $(CC) -o $@ $(OBJ) $(LDFLAGS) + +install: coreupdown + mkdir -p -- "$(DESTDIR)$(PREFIX)/bin" + 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" + cp -- coreupdown "$(DESTDIR)$(PREFIX)/bin/coreup" + ln -sf coreup "$(DESTDIR)$(PREFIX)/bin/coredown" + cp -- coreup.1 coredown.1 "$(DESTDIR)$(MANPREFIX)/man1" + +postinstall: + chown '0:0' "$(DESTDIR)$(PREFIX)/bin/coreup" + chmod '4755' "$(DESTDIR)$(PREFIX)/bin/coreup" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/bin/coreup" + -rm -f -- "$(DESTDIR)$(PREFIX)/bin/coredown" + -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/coreup.1" + -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/coredown.1" + +clean: + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch *.gcov *.gcno *.gcda + -rm -f -- coreupdown + +.SUFFIXES: +.SUFFIXES: .o .c + +.PHONY: all install uninstall clean |