From 0b662fc0f4d85077cbd8b03e5d04de8c3629dd36 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 17:40:11 +0100 Subject: [PATCH] A bunch of hacks to allow builds to understand the stupid windows filenames --- Makefile | 11 ++++++----- config.mak.in | 3 +++ configure.ac | 5 +++++ tools/Makefile | 21 ++++++++++++++++----- 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 840a120..628b8fc 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ all: export CC export AR +export EXE export CFLAGS export LDFLAGS export LDLIBS @@ -147,11 +148,11 @@ N2N_DEPS+=win32/n2n_win32.a SUBDIRS+=win32 endif -APPS=edge -APPS+=supernode -APPS+=example_edge_embed_quick_edge_init -APPS+=example_edge_embed -APPS+=example_sn_embed +APPS=edge$(EXE) +APPS+=supernode$(EXE) +APPS+=example_edge_embed_quick_edge_init$(EXE) +APPS+=example_edge_embed$(EXE) +APPS+=example_sn_embed$(EXE) DOCS=edge.8.gz supernode.1.gz n2n.7.gz diff --git a/config.mak.in b/config.mak.in index 29af368..1ea0bfa 100644 --- a/config.mak.in +++ b/config.mak.in @@ -6,9 +6,12 @@ CONFIG_HOST_OS=@host_os@ CONFIG_PREFIX=@prefix@ PACKAGE_VERSION=@PACKAGE_VERSION@ + CC=@CC@ AR=@AR@ WINDRES=@WINDRES@ +EXE=@EXE@ + CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ LDLIBS_EXTRA=@LIBS@ diff --git a/configure.ac b/configure.ac index 641fdaf..05a1877 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,10 @@ case "$host_os" in ;; mingw*) LIBS="-lnetapi32 -lws2_32 -liphlpapi $LIBS" + EXE=".exe" + ;; + *) + EXE="" ;; esac @@ -114,6 +118,7 @@ AS_IF([test "x$enable_pthread" != xno], AC_SUBST(host) AC_SUBST(host_os) +AC_SUBST(EXE) AC_SUBST(WINDRES) AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_FILES(config.mak) diff --git a/tools/Makefile b/tools/Makefile index 02fe68c..96b6695 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -15,11 +15,18 @@ LDFLAGS+=-L.. N2N_LIB=../libn2n.a -TOOLS=n2n-benchmark n2n-keygen n2n-route n2n-portfwd n2n-decode - -TESTS=tests-compress tests-elliptic tests-hashing tests-transform -TESTS+=tests-wire -TESTS+=tests-auth +TOOLS+=n2n-benchmark$(EXE) +TOOLS+=n2n-keygen$(EXE) +TOOLS+=n2n-route$(EXE) +TOOLS+=n2n-portfwd$(EXE) +TOOLS+=n2n-decode$(EXE) + +TESTS=tests-compress$(EXE) +TESTS+=tests-elliptic$(EXE) +TESTS+=tests-hashing$(EXE) +TESTS+=tests-transform$(EXE) +TESTS+=tests-wire$(EXE) +TESTS+=tests-auth$(EXE) .PHONY: all clean install all: $(TOOLS) $(TESTS) @@ -30,6 +37,10 @@ n2n-route.o: $(N2N_LIB) $(HEADERS) ../config.mak n2n-portfwd.o: $(N2N_LIB) $(HEADERS) ../config.mak n2n-decode.o: $(N2N_LIB) $(HEADERS) ../config.mak +# HACK for windows. +%.exe: % + cp $< $@ + # See comments in the topdir Makefile about how to generate coverage # data. gcov: