n2n/tools/Makefile.in
Hamish Coleman 35ec7336a6
simplified the makefiles (#795)
* Move the makefiles towards a clearer arrangement

* Break circular make dependancy and start using implicit rules for most compilation

* Fix old cmake to compile again after renames
2021-09-16 18:34:04 +05:45

45 lines
861 B
Makefile

CC=@CC@
DEBUG?=-g3
OPTIMIZATION?=-O2 #-march=native
WARN?=-Wall
INSTALL=install
INSTALL_PROG=$(INSTALL) -m755
MKDIR=mkdir -p
PREFIX?=$(DESTDIR)/usr
ifeq ($(OS),Darwin)
SBINDIR=$(PREFIX)/local/sbin
else
SBINDIR=$(PREFIX)/sbin
endif
LDLIBS+=-ln2n
LDLIBS+=@N2N_LIBS@
HEADERS=$(wildcard include/*.h)
CFLAGS+=-I../include @CFLAGS@
LDFLAGS+=-L..
CFLAGS+=$(DEBUG) $(OPTIMIZATION) $(WARN)
LDFLAGS+=@LDFLAGS@
N2N_LIB=../libn2n.a
TOOLS=n2n-benchmark n2n-keygen
TOOLS+=@ADDITIONAL_TOOLS@
.PHONY: all clean install
all: $(TOOLS)
n2n-benchmark.o: $(N2N_LIB) $(HEADERS) ../Makefile Makefile
n2n-keygen.o: $(N2N_LIB) $(HEADERS) ../Makefile Makefile
n2n-decode: n2n-decode.c $(N2N_LIB) $(HEADERS) ../Makefile Makefile
$(CC) $(CFLAGS) $< $(LDFLAGS) $(LDLIBS) -lpcap -o $@
clean:
rm -rf $(TOOLS) *.o *.dSYM *~
install: $(TOOLS)
$(INSTALL_PROG) $(TOOLS) $(SBINDIR)/