aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMattias Andrée <m@maandree.se>2026-03-04 18:51:23 +0100
committerMattias Andrée <m@maandree.se>2026-03-04 18:53:28 +0100
commit15d3290b1d95cedaf4e671fe346beb11dcd12ac9 (patch)
tree86c959933f7574104cc5d16c0c0122d40842bed1 /Makefile
downloadgit-protection-15d3290b1d95cedaf4e671fe346beb11dcd12ac9.tar.gz
git-protection-15d3290b1d95cedaf4e671fe346beb11dcd12ac9.tar.bz2
git-protection-15d3290b1d95cedaf4e671fe346beb11dcd12ac9.tar.xz
First commitHEAD1.0master
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..0b22ed7
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,42 @@
+.POSIX:
+
+CONFIGFILE = config.mk
+include $(CONFIGFILE)
+
+OBJ =\
+ git-protection.o
+
+HDR =
+
+all: git-protection
+$(OBJ): $(HDR)
+
+.c.o:
+ $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
+
+git-protection: $(OBJ)
+ $(CC) -o $@ $(OBJ) $(LDFLAGS)
+ $(BUILD_SUDO) sh -c 'chown -- 0:0 $@ && chmod -- 4755 $@'
+
+install: git-protection
+ mkdir -p -- "$(DESTDIR)$(PREFIX)/bin"
+ mkdir -p -- "$(DESTDIR)$(MANPREFIX)/man1/"
+ cp -- git-protection "$(DESTDIR)$(PREFIX)/bin/"
+ cp -- git-protection.1 "$(DESTDIR)$(MANPREFIX)/man1/"
+
+post-install:
+ chown -- '0:0' "$(DESTDIR)$(PREFIX)/bin/git-protection"
+ chmod -- 4755 "$(DESTDIR)$(PREFIX)/bin/git-protection"
+
+uninstall:
+ -rm -f -- "$(DESTDIR)$(PREFIX)/bin/git-protection"
+ -rm -f -- "$(DESTDIR)$(MANPREFIX)/man1/git-protection.1"
+
+clean:
+ -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.gch *.gcov *.gcno *.gcda
+ -rm -f -- git-protection
+
+.SUFFIXES:
+.SUFFIXES: .o .c
+
+.PHONY: all install post-install uninstall clean