2021-10-05 21:07:15 +02:00
|
|
|
#
|
|
|
|
# This is not a standalone makefile, it must be called from the toplevel
|
|
|
|
# makefile to inherit the correct environment
|
|
|
|
|
2019-09-21 16:12:43 +02:00
|
|
|
DEBUG?=-g3
|
2019-09-21 16:26:18 +02:00
|
|
|
|
2020-06-21 22:26:27 +02:00
|
|
|
HEADERS=$(wildcard include/*.h)
|
2021-10-05 21:07:15 +02:00
|
|
|
CFLAGS+=-I../include
|
2023-05-01 02:44:38 +02:00
|
|
|
|
2023-07-02 18:01:28 +02:00
|
|
|
ifneq (,$(findstring mingw,$(CONFIG_HOST_OS)))
|
2021-10-05 21:07:15 +02:00
|
|
|
CFLAGS+=-I../win32
|
|
|
|
endif
|
|
|
|
CFLAGS+=$(DEBUG)
|
2019-09-21 16:12:43 +02:00
|
|
|
LDFLAGS+=-L..
|
|
|
|
|
|
|
|
N2N_LIB=../libn2n.a
|
|
|
|
|
2023-07-01 14:39:02 +02:00
|
|
|
TOOLS=n2n-benchmark n2n-keygen n2n-route n2n-portfwd n2n-decode
|
2019-09-21 16:12:43 +02:00
|
|
|
|
2021-09-27 11:41:06 +02:00
|
|
|
TESTS=tests-compress tests-elliptic tests-hashing tests-transform
|
|
|
|
TESTS+=tests-wire
|
2021-11-10 07:02:05 +01:00
|
|
|
TESTS+=tests-auth
|
2019-09-21 16:12:43 +02:00
|
|
|
|
2021-09-27 11:41:06 +02:00
|
|
|
.PHONY: all clean install
|
|
|
|
all: $(TOOLS) $(TESTS)
|
2019-09-21 16:12:43 +02:00
|
|
|
|
2023-05-01 03:45:44 +02:00
|
|
|
n2n-benchmark.o: $(N2N_LIB) $(HEADERS) ../config.mak
|
|
|
|
n2n-keygen.o: $(N2N_LIB) $(HEADERS) ../config.mak
|
|
|
|
n2n-route.o: $(N2N_LIB) $(HEADERS) ../config.mak
|
|
|
|
n2n-portfwd.o: $(N2N_LIB) $(HEADERS) ../config.mak
|
2023-07-01 14:39:02 +02:00
|
|
|
n2n-decode.o: $(N2N_LIB) $(HEADERS) ../config.mak
|
2019-09-21 16:12:43 +02:00
|
|
|
|
2021-09-27 11:41:06 +02:00
|
|
|
# See comments in the topdir Makefile about how to generate coverage
|
|
|
|
# data.
|
|
|
|
gcov:
|
|
|
|
gcov $(TOOLS) $(TESTS)
|
|
|
|
|
2019-09-21 16:12:43 +02:00
|
|
|
clean:
|
2020-06-21 22:33:28 +02:00
|
|
|
rm -rf $(TOOLS) *.o *.dSYM *~
|
2021-09-27 11:41:06 +02:00
|
|
|
rm -f $(TESTS) *.gcno *.gcda
|
2019-09-21 16:12:43 +02:00
|
|
|
|
|
|
|
install: $(TOOLS)
|
|
|
|
$(INSTALL_PROG) $(TOOLS) $(SBINDIR)/
|