#
+OPTIMISE= -O2
CFLAGS= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith \
- -Wwrite-strings -g
+ -Wwrite-strings -g $(OPTIMISE) -D_GNU_SOURCE
-all: service
+etcdir= /etc
+prefix= /usr/local
+bindir= $(prefix)/bin
+
+libdir= $(prefix)/lib
+libuserv= $(libdir)/userv
+
+etcuserv= $(etcdir)/userv
+services= $(etcuserv)/services.d
+
+TARGETS= service
+
+all: $(TARGETS)
+
+install: all
+ 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