X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=Makefile;h=66de24252d9394b3e200ac44dea150a228ee6ef1;hb=e49dc7b9511adbcfeed98a2f5ac5d3a121d1d4e4;hp=f6259972cb5a2b6d7ccc3bad5d5abfdc9c91ad94;hpb=463b5543f785f68c5a8978adc8010aab8f0fe0bb;p=repo_shell.git diff --git a/Makefile b/Makefile index f625997..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,24 +15,31 @@ 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 mystrtok.c stra.c utility.c version.c +repo_shell: repo_shell.c inih/ini.c git_acl.c stringutils.c stra.c utility.c version.c $(CC) -I inih $^ -o $@ -mystrtok_test: mystrtok_test.c mystrtok.c utility.c +mystrtok_test: mystrtok_test.c stringutils.c utility.c $(CC) -g $^ -o $@ -acl_test: acl_test.c git_acl.c inih/ini.c mystrtok.c stra.c utility.c +acl_test: acl_test.c git_acl.c inih/ini.c stringutils.c stra.c utility.c $(CC) -I inih $^ -o $@ $(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)