chiark / gitweb /
Install with cp -b.
[userv-utils.git] / ipif / Makefile
index c8f66734e384f19e05d955de86e16bd756107a10..9445e0824a02f5a769defdc7499c180c7eba693f 100644 (file)
@@ -1,18 +1,26 @@
 #
 
+OPTIMISE=      -O2
 CFLAGS=                -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \
-               -Wwrite-strings -g -D_GNU_SOURCE
+               -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE
 
-etc=           /etc
+etcdir=                /etc
 prefix=                /usr/local
-libipif=       $(prefix)/lib/userv-ipif
-etcipif=       $(etc)/userv/ipif
+bindir=                $(prefix)/bin
+
+libdir=                $(prefix)/lib
+libuserv=      $(libdir)/userv
+
+etcuserv=      $(etcdir)/userv
+services=      $(etcuserv)/services.d
 
 TARGETS=       service
 
 all:           $(TARGETS)
 
 install:       all
-               mkdir -p $(libipif) $(etcipif)
-               cp service alloc.pl $(libdir)/.
-               touch $(etcipif)/networks
+               mkdir -p $(libuserv) $(services)
+               cp -b service $(libuserv)/ipif
+               cp ipif $(services)/ipif:new
+               cp -b udptunnel $(bindir)/.
+               set -e; cd $(services); test -f ipif || mv ipif:new ipif