From 275fc799ed112b0d41ccaa872e3da87328ad21c1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 24 Feb 2024 17:34:31 +0100 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 -- cgit v1.2.3-70-g09d2