You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
922 B

CC?=gcc
DEBUG?=-g3
5 years ago
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
LIBS_EDGE_OPT=@N2N_LIBS@
LIBS_EDGE+=$(LIBS_EDGE_OPT)
HEADERS=$(wildcard include/*.h)
CFLAGS+=-I../include @CFLAGS@
LDFLAGS+=-L..
CFLAGS+=$(DEBUG) $(OPTIMIZATION) $(WARN)
5 years ago
LDFLAGS=@LDFLAGS@
N2N_LIB=../libn2n.a
TOOLS=n2n-benchmark
TOOLS+=@ADDITIONAL_TOOLS@
.PHONY: all clean install
all: $(TOOLS)
n2n-benchmark: benchmark.c $(N2N_LIB) $(HEADERS)
5 years ago
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -o $@
n2n-decode: n2n_decode.c $(N2N_LIB) $(HEADERS)
5 years ago
$(CC) $(CFLAGS) $< $(LDFLAGS) $(N2N_LIB) $(LIBS_EDGE) -lpcap -o $@
.c.o: $(HEADERS) ../Makefile Makefile
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -rf $(TOOLS) *.o *.dSYM *~
install: $(TOOLS)
$(INSTALL_PROG) $(TOOLS) $(SBINDIR)/