From: R. Steve McKown Date: Fri, 28 Sep 2012 19:07:15 +0000 (-0600) Subject: Add make install, uninstall targets X-Git-Tag: 0.5~18 X-Git-Url: https://oss.titaniummirror.com/gitweb?p=repo_shell.git;a=commitdiff_plain;h=3915e7b7e2478b3badf3754a870f1f0d5426d5ed Add make install, uninstall targets --- diff --git a/Makefile b/Makefile index d9d1847..66de242 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,10 @@ MAIN := repo_shell # Git derives its version "prefix" from tags +PREFIX = /usr/local +PROGRAMS = $(MAIN) mystrtok_test acl_test +SCRIPTS = $(shell ls scripts/*) + # Add TMI's mkversion to render files xxx.in -> xxx, updating __appVersion__ # Massage the version coming back because setup.py build to exe only wants # versions of the form a.b.c.d. We'll use this to our advantage to cause @@ -11,8 +15,6 @@ INFILES := $(shell ls *.in 2>/dev/null) INFILES := $(INFILES:%.in=%) #$(warning INFILES $(INFILES)) -PROGRAMS = $(MAIN) mystrtok_test acl_test - all: $(MAIN) repo_shell: repo_shell.c inih/ini.c git_acl.c stringutils.c stra.c utility.c version.c @@ -28,7 +30,16 @@ $(INFILES):%: %.in @sed -e 's|__appVersion__|$(VERSION)|g' < $^ > $@-tmp @diff -q $@-tmp $@ >/dev/null 2>&1 && rm -f $@-tmp || mv $@-tmp $@ +install: $(MAIN) $(SCRIPTS) + @install -D -o root -g root -m 4755 $(MAIN) $(PREFIX)/bin/$(MAIN) + @install -D -o root -g root -m 4755 $(MAIN) $(PREFIX)/bin/$(MAIN) + @install -o root -g root -m 4755 $(SCRIPTS) $(PREFIX)/bin + +uninstall: + @rm -f $(PREFIX)/bin/$(MAIN) + @for i in $(SCRIPTS); do rm -f $(PREFIX)/bin/$$i; done + clean: @rm -rf $(PROGRAMS) $(INFILES) -.PHONY: all clean $(INFILES) +.PHONY: all insall uninstall clean $(INFILES)