A bunch of hacks to allow builds to understand the stupid windows filenames

This commit is contained in:
Hamish Coleman 2023-07-02 17:40:11 +01:00
parent 4d2e92ac81
commit 0b662fc0f4
4 changed files with 29 additions and 9 deletions

View File

@ -3,6 +3,7 @@ all:
export CC export CC
export AR export AR
export EXE
export CFLAGS export CFLAGS
export LDFLAGS export LDFLAGS
export LDLIBS export LDLIBS
@ -147,11 +148,11 @@ N2N_DEPS+=win32/n2n_win32.a
SUBDIRS+=win32 SUBDIRS+=win32
endif endif
APPS=edge APPS=edge$(EXE)
APPS+=supernode APPS+=supernode$(EXE)
APPS+=example_edge_embed_quick_edge_init APPS+=example_edge_embed_quick_edge_init$(EXE)
APPS+=example_edge_embed APPS+=example_edge_embed$(EXE)
APPS+=example_sn_embed APPS+=example_sn_embed$(EXE)
DOCS=edge.8.gz supernode.1.gz n2n.7.gz DOCS=edge.8.gz supernode.1.gz n2n.7.gz

View File

@ -6,9 +6,12 @@ CONFIG_HOST_OS=@host_os@
CONFIG_PREFIX=@prefix@ CONFIG_PREFIX=@prefix@
PACKAGE_VERSION=@PACKAGE_VERSION@ PACKAGE_VERSION=@PACKAGE_VERSION@
CC=@CC@ CC=@CC@
AR=@AR@ AR=@AR@
WINDRES=@WINDRES@ WINDRES=@WINDRES@
EXE=@EXE@
CFLAGS=@CFLAGS@ CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@ LDFLAGS=@LDFLAGS@
LDLIBS_EXTRA=@LIBS@ LDLIBS_EXTRA=@LIBS@

View File

@ -20,6 +20,10 @@ case "$host_os" in
;; ;;
mingw*) mingw*)
LIBS="-lnetapi32 -lws2_32 -liphlpapi $LIBS" LIBS="-lnetapi32 -lws2_32 -liphlpapi $LIBS"
EXE=".exe"
;;
*)
EXE=""
;; ;;
esac esac
@ -114,6 +118,7 @@ AS_IF([test "x$enable_pthread" != xno],
AC_SUBST(host) AC_SUBST(host)
AC_SUBST(host_os) AC_SUBST(host_os)
AC_SUBST(EXE)
AC_SUBST(WINDRES) AC_SUBST(WINDRES)
AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_HEADERS(include/config.h)
AC_CONFIG_FILES(config.mak) AC_CONFIG_FILES(config.mak)

View File

@ -15,11 +15,18 @@ LDFLAGS+=-L..
N2N_LIB=../libn2n.a N2N_LIB=../libn2n.a
TOOLS=n2n-benchmark n2n-keygen n2n-route n2n-portfwd n2n-decode TOOLS+=n2n-benchmark$(EXE)
TOOLS+=n2n-keygen$(EXE)
TOOLS+=n2n-route$(EXE)
TOOLS+=n2n-portfwd$(EXE)
TOOLS+=n2n-decode$(EXE)
TESTS=tests-compress tests-elliptic tests-hashing tests-transform TESTS=tests-compress$(EXE)
TESTS+=tests-wire TESTS+=tests-elliptic$(EXE)
TESTS+=tests-auth TESTS+=tests-hashing$(EXE)
TESTS+=tests-transform$(EXE)
TESTS+=tests-wire$(EXE)
TESTS+=tests-auth$(EXE)
.PHONY: all clean install .PHONY: all clean install
all: $(TOOLS) $(TESTS) all: $(TOOLS) $(TESTS)
@ -30,6 +37,10 @@ n2n-route.o: $(N2N_LIB) $(HEADERS) ../config.mak
n2n-portfwd.o: $(N2N_LIB) $(HEADERS) ../config.mak n2n-portfwd.o: $(N2N_LIB) $(HEADERS) ../config.mak
n2n-decode.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 # See comments in the topdir Makefile about how to generate coverage
# data. # data.
gcov: gcov: