Makefile
changeset 11 2fdc6206e792
parent 10 59cd8ce44290
child 12 1f683c5eef8f
--- a/Makefile	Fri Aug 05 21:19:04 2005 +0000
+++ b/Makefile	Fri Aug 19 13:10:19 2005 +0000
@@ -2,35 +2,41 @@
 # $Id$
 # $URL$
 
-BIN = exiacl
+SCRIPTS = exiacl
+CLEANFILES = exiacl
+
+prefix = /usr/local
+bindir = $(prefix)/bin
 
-p = exiacl
-stowdir = /usr/local/stow
+STOW := $(shell which stow)
+ifdef STOW
+    override prefix := $(prefix)/stow/exiacl
+endif
 
-prefix = $(stowdir)/$(p)
-bindir = $(prefix)/bin
 
 .PHONY: all install clean uninstall
 
-all:	.ok.$(BIN)
-	@test -x $(BIN) || chmod +x $(BIN)
+all:	$(SCRIPTS)
 
-install:    $(BIN)
+install:    all
 	install -d $(bindir)
-	install -m 0755 $(BIN) $(bindir)/
-	stow -d $(stowdir) -vR $(p)
+	install -m 0755 $(SCRIPTS) $(bindir)
+ifdef STOW
+	stow -d $(prefix)/.. -vR $(p)
+endif
 
 clean:
-	@-rm -fv .ok.*
+	@-rm -fv $(CLEANFILES)
 
 uninstall:  
 	stow -d $(stowdir) -vD $(p)
 	rm -rf $(stowdir)/$(p)
     
     
-.ok.%:	%
+%:	%.pl
 	@perl -c $<
-	@touch $@
+	@cp -f $< $@
+	@chmod -w+x $@
 
 
 # vim:sts=4 sw=4 aw ai sm: