--- ./Makefile.in.~1~ 2014-12-14 12:59:41.000000000 +0100 +++ ./Makefile.in 2016-11-20 00:07:51.307370977 +0100 @@ -19,24 +19,27 @@ CC = gcc LD = ld -CFLAGS = -O2 -Wall -I. +CFLAGS = @CFLAGS@ +LDFLAGS = @LDFLAGS@ INSTALL = @INSTALL@ exec_prefix = @prefix@ BINDIR = @sbindir@ +SRCDIR = @srcdir@ +DESTDIR = @prefix@ -all: tunctl +all: tunctl -tunctl: tunctl.c if_tun.h - $(CC) $(CFLAGS) tunctl.c -o tunctl +tunctl: $(SRCDIR)/tunctl.c $(SRCDIR)/if_tun.h + $(CC) $(CFLAGS) $(LDFLAGS) $(SRCDIR)/tunctl.c -o tunctl install: all - $(INSTALL) -d $(BINDIR) - $(INSTALL) -m 755 -o root -g root tunctl $(BINDIR) + $(INSTALL) -d $(DESTDIR)$(BINDIR) + $(INSTALL) -m 755 tunctl $(DESTDIR)$(BINDIR) uninstall: - rm $(BINDIR)/tunctl + rm $(DESTDIR)$(BINDIR)/tunctl clean: distclean rm -f tunctl *.o *~