Convert the tools dir makefile similarly to the topdir

This commit is contained in:
Hamish Coleman 2023-04-30 18:07:40 -05:00
parent bee517a753
commit bd4418fdec
5 changed files with 12 additions and 8 deletions

2
.gitignore vendored
View File

@ -8,7 +8,7 @@ config.rpath
config.status config.status
include/config.h include/config.h
include/config.h.in include/config.h.in
tools/Makefile tools/config.mak
autom4te.cache autom4te.cache
edge edge
example_edge_embed_quick_edge_init example_edge_embed_quick_edge_init

View File

@ -89,7 +89,7 @@ AS_IF([test "x$enable_pcap" != xno],
[ [
AC_DEFINE([N2N_HAVE_PCAP], [1], [Have PCAP library]) AC_DEFINE([N2N_HAVE_PCAP], [1], [Have PCAP library])
N2N_LIBS_EXTRA="-lpcap ${N2N_LIBS_EXTRA}" N2N_LIBS_EXTRA="-lpcap ${N2N_LIBS_EXTRA}"
ADDITIONAL_TOOLS="$ADDITIONAL_TOOLS n2n-decode" TOOLS_ADDITIONAL="$TOOLS_ADDITIONAL n2n-decode"
# TODO # TODO
# - pcap_set_immediate_mode has been available since libpcap 1.5 # - pcap_set_immediate_mode has been available since libpcap 1.5
@ -151,9 +151,9 @@ AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS) AC_SUBST(LDFLAGS)
AC_SUBST(N2N_VERSION) AC_SUBST(N2N_VERSION)
AC_SUBST(N2N_LIBS_EXTRA) AC_SUBST(N2N_LIBS_EXTRA)
AC_SUBST(ADDITIONAL_TOOLS) AC_SUBST(TOOLS_ADDITIONAL)
AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_HEADERS(include/config.h)
AC_CONFIG_FILES(config.mak) AC_CONFIG_FILES(config.mak)
AC_CONFIG_FILES(tools/Makefile) AC_CONFIG_FILES(tools/config.mak)
AC_OUTPUT AC_OUTPUT

View File

@ -11,9 +11,9 @@ LDFLAGS=$LDFLAGS
N2N_LIBS_EXTRA=$LDLIBS N2N_LIBS_EXTRA=$LDLIBS
EOF EOF
sed \ cat >tools/config.mak <<EOF
-e "s%@ADDITIONAL_TOOLS@%%g" \ TOOLS_ADDITIONAL=
< tools/Makefile.in > tools/Makefile EOF
cat <<EOF >include/config.h cat <<EOF >include/config.h
#define PACKAGE_VERSION "FIXME" #define PACKAGE_VERSION "FIXME"

View File

@ -2,6 +2,8 @@
# This is not a standalone makefile, it must be called from the toplevel # This is not a standalone makefile, it must be called from the toplevel
# makefile to inherit the correct environment # makefile to inherit the correct environment
include config.mak
DEBUG?=-g3 DEBUG?=-g3
HEADERS=$(wildcard include/*.h) HEADERS=$(wildcard include/*.h)
@ -16,7 +18,7 @@ LDFLAGS+=-L..
N2N_LIB=../libn2n.a N2N_LIB=../libn2n.a
TOOLS=n2n-benchmark n2n-keygen n2n-route n2n-portfwd TOOLS=n2n-benchmark n2n-keygen n2n-route n2n-portfwd
TOOLS+=@ADDITIONAL_TOOLS@ TOOLS+=$(TOOLS_ADDITIONAL)
TESTS=tests-compress tests-elliptic tests-hashing tests-transform TESTS=tests-compress tests-elliptic tests-hashing tests-transform
TESTS+=tests-wire TESTS+=tests-wire

2
tools/config.mak.in Normal file
View File

@ -0,0 +1,2 @@
TOOLS_ADDITIONAL=@TOOLS_ADDITIONAL@