Makefile
changeset 11 2fdc6206e792
parent 10 59cd8ce44290
child 12 1f683c5eef8f
equal deleted inserted replaced
10:59cd8ce44290 11:2fdc6206e792
     1 # © Heiko Schlittermann
     1 # © Heiko Schlittermann
     2 # $Id$
     2 # $Id$
     3 # $URL$
     3 # $URL$
     4 
     4 
     5 BIN = exiacl
     5 SCRIPTS = exiacl
       
     6 CLEANFILES = exiacl
     6 
     7 
     7 p = exiacl
     8 prefix = /usr/local
     8 stowdir = /usr/local/stow
     9 bindir = $(prefix)/bin
     9 
    10 
    10 prefix = $(stowdir)/$(p)
    11 STOW := $(shell which stow)
    11 bindir = $(prefix)/bin
    12 ifdef STOW
       
    13     override prefix := $(prefix)/stow/exiacl
       
    14 endif
       
    15 
    12 
    16 
    13 .PHONY: all install clean uninstall
    17 .PHONY: all install clean uninstall
    14 
    18 
    15 all:	.ok.$(BIN)
    19 all:	$(SCRIPTS)
    16 	@test -x $(BIN) || chmod +x $(BIN)
       
    17 
    20 
    18 install:    $(BIN)
    21 install:    all
    19 	install -d $(bindir)
    22 	install -d $(bindir)
    20 	install -m 0755 $(BIN) $(bindir)/
    23 	install -m 0755 $(SCRIPTS) $(bindir)
    21 	stow -d $(stowdir) -vR $(p)
    24 ifdef STOW
       
    25 	stow -d $(prefix)/.. -vR $(p)
       
    26 endif
    22 
    27 
    23 clean:
    28 clean:
    24 	@-rm -fv .ok.*
    29 	@-rm -fv $(CLEANFILES)
    25 
    30 
    26 uninstall:  
    31 uninstall:  
    27 	stow -d $(stowdir) -vD $(p)
    32 	stow -d $(stowdir) -vD $(p)
    28 	rm -rf $(stowdir)/$(p)
    33 	rm -rf $(stowdir)/$(p)
    29     
    34     
    30     
    35     
    31 .ok.%:	%
    36 %:	%.pl
    32 	@perl -c $<
    37 	@perl -c $<
    33 	@touch $@
    38 	@cp -f $< $@
       
    39 	@chmod -w+x $@
    34 
    40 
    35 
    41 
    36 # vim:sts=4 sw=4 aw ai sm:
    42 # vim:sts=4 sw=4 aw ai sm: