From b4e1a25d89fb939bb70c33fbc8fa35d322c16d06 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 15:31:44 +0100 Subject: [PATCH 01/12] Move OpenSolaris special config to the configure script --- Makefile | 7 ------- configure.ac | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index fb64d4d49..6683fb1f1 100644 --- a/Makefile +++ b/Makefile @@ -49,8 +49,6 @@ ifeq ($(shell uname -o),Msys) CONFIG_TARGET=mingw else ifeq ($(shell uname -s),Darwin) CONFIG_TARGET=darwin -else ifeq ($(shell uname), SunOS) -CONFIG_TARGET=sunos else CONFIG_TARGET=generic endif @@ -162,11 +160,6 @@ LINT_CCODE=\ LDLIBS+=-ln2n LDLIBS+=$(LDLIBS_EXTRA) -#For OpenSolaris (Solaris too?) -ifeq ($(CONFIG_TARGET), sunos) -LDLIBS+=-lsocket -lnsl -endif - ifeq ($(CONFIG_TARGET),mingw) CFLAGS+=-I. -I./win32 LDLIBS+=$(abspath win32/n2n_win32.a) diff --git a/configure.ac b/configure.ac index 354eebe7e..b4c560463 100644 --- a/configure.ac +++ b/configure.ac @@ -12,6 +12,14 @@ AC_PROG_CC AC_CHECK_TOOL([AR], [ar], [false]) AC_CHECK_TOOL([WINDRES], [windres], [windres]) +case "$host_os" in + *-solaris*) + # Was in Makefile with the test `uname` -eq "SunOS" + # and comment "For OpenSolaris (Solaris too?)" + LIBS="-lsocket -lnsl $LIBS" + ;; +esac + # TODO: ideally, should use AC_ARG_ENABLE AC_ARG_WITH([edgex], AS_HELP_STRING([--with-edgex], [Build for Ubiquity-X]), From 8fe5ae5afde278e889ae553326bedcf9ae7abae8 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 15:49:51 +0100 Subject: [PATCH 02/12] Move the macos default install path config. There is a minor change - after this, the macos man pages are also installed into the /usr/local PREFIX. This seems like the correct location to me. Longer term, the usual autotools process of installing everything into /usr/local should be used. Files installed in /usr should be done by a package management tool, so this default makes sense to use. --- Makefile | 8 ++------ config.mak.in | 2 ++ configure.ac | 13 ++++++++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 6683fb1f1..cf890c7fc 100644 --- a/Makefile +++ b/Makefile @@ -66,13 +66,9 @@ INSTALL_PROG=$(INSTALL) -m755 INSTALL_DOC=$(INSTALL) -m644 # DESTDIR set in debian make system -PREFIX?=$(DESTDIR)/usr -ifeq ($(CONFIG_TARGET),darwin) -SBINDIR=$(PREFIX)/local/sbin -else -SBINDIR=$(PREFIX)/sbin -endif +PREFIX?=$(DESTDIR)/$(CONFIG_PREFIX) +SBINDIR=$(PREFIX)/sbin MANDIR?=$(PREFIX)/share/man MAN1DIR=$(MANDIR)/man1 MAN7DIR=$(MANDIR)/man7 diff --git a/config.mak.in b/config.mak.in index 7db29d236..8e4f24314 100644 --- a/config.mak.in +++ b/config.mak.in @@ -2,6 +2,8 @@ # @configure_input@ CONFIG_HOST=@host@ +CONFIG_PREFIX=@prefix@ + PACKAGE_VERSION=@PACKAGE_VERSION@ CC=@CC@ AR=@AR@ diff --git a/configure.ac b/configure.ac index b4c560463..b22449a45 100644 --- a/configure.ac +++ b/configure.ac @@ -13,13 +13,24 @@ AC_CHECK_TOOL([AR], [ar], [false]) AC_CHECK_TOOL([WINDRES], [windres], [windres]) case "$host_os" in - *-solaris*) + solaris*) # Was in Makefile with the test `uname` -eq "SunOS" # and comment "For OpenSolaris (Solaris too?)" LIBS="-lsocket -lnsl $LIBS" ;; esac +# This replicates the old config logic from the Makefile. +# TODO: remove all this and just use the autotools default prefix +# (which is "/usr/local") +case "$host_os" in + darwin*) + ;; + *) + AC_PREFIX_DEFAULT(/usr) + ;; +esac + # TODO: ideally, should use AC_ARG_ENABLE AC_ARG_WITH([edgex], AS_HELP_STRING([--with-edgex], [Build for Ubiquity-X]), From 44e4195b6a084287308cc877a6dd216e91cec2d9 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 16:09:40 +0100 Subject: [PATCH 03/12] Convert final user of TARGET==darwin to use the cross-compile variables instead --- .github/workflows/tests.yml | 8 -------- Makefile | 24 +++++++++++++----------- config.mak.in | 1 + configure.ac | 1 + 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d81713cbb..82db48b4d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -346,14 +346,6 @@ jobs: run: | git fetch --force --tags - - - name: generate a makefile and use it to install more packages - run: | - # This is a pretty big hammer, but gets the windows compile moving - ./scripts/hack_fakeautoconf.sh - make build-dep - shell: bash - - name: Run a configure step run: | export CFLAGS="-fprofile-arcs -ftest-coverage" diff --git a/Makefile b/Makefile index cf890c7fc..c4204e11b 100644 --- a/Makefile +++ b/Makefile @@ -47,10 +47,6 @@ export CONFIG_TARGET ifndef CONFIG_TARGET ifeq ($(shell uname -o),Msys) CONFIG_TARGET=mingw -else ifeq ($(shell uname -s),Darwin) -CONFIG_TARGET=darwin -else -CONFIG_TARGET=generic endif endif @@ -172,7 +168,7 @@ APPS+=example_sn_embed DOCS=edge.8.gz supernode.1.gz n2n.7.gz -# This is the superset of all packages that might be needed during the build. +# This is the list of Debian/Ubuntu packages that are needed during the build. # Mostly of use in automated build systems. BUILD_DEP:=\ autoconf \ @@ -282,15 +278,21 @@ gcov: # This is a convinent target to use during development or from a CI/CD system .PHONY: build-dep -build-dep: -ifeq ($(CONFIG_TARGET),generic) - sudo apt install $(BUILD_DEP) -else ifeq ($(CONFIG_TARGET),darwin) - brew install automake gcovr + +ifneq (,$(findstring darwin,$(CONFIG_HOST_OS))) +build-dep: build-dep-brew else - echo Not attempting to install dependancies for system $(CONFIG_TARGET) +build-dep: build-dep-dpkg endif +.PHONY: build-dep-dpkg +build-dep-dpkg: + sudo apt install $(BUILD_DEP) + +.PHONY: build-dep-brew +build-dep-brew: + brew install automake gcovr + .PHONY: clean clean: rm -f src/edge.o src/supernode.o src/example_edge_embed.o src/example_edge_embed_quick_edge_init.o src/example_sn_embed.o diff --git a/config.mak.in b/config.mak.in index 8e4f24314..29af36822 100644 --- a/config.mak.in +++ b/config.mak.in @@ -2,6 +2,7 @@ # @configure_input@ CONFIG_HOST=@host@ +CONFIG_HOST_OS=@host_os@ CONFIG_PREFIX=@prefix@ PACKAGE_VERSION=@PACKAGE_VERSION@ diff --git a/configure.ac b/configure.ac index b22449a45..f79d15432 100644 --- a/configure.ac +++ b/configure.ac @@ -110,6 +110,7 @@ AS_IF([test "x$enable_pthread" != xno], AC_SUBST(host) +AC_SUBST(host_os) AC_SUBST(WINDRES) AC_CONFIG_HEADERS(include/config.h) AC_CONFIG_FILES(config.mak) From 47538fea2ce5f0c65b420c87cf177487bcb2f936 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 16:55:56 +0100 Subject: [PATCH 04/12] Dont include unneeded headers --- include/n2n.h | 1 - include/n2n_wire.h | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/n2n.h b/include/n2n.h index d8b9b3a67..3b5c12d8f 100644 --- a/include/n2n.h +++ b/include/n2n.h @@ -61,7 +61,6 @@ #include /* for privilege check in tools/n2n-route */ #include #include /* for privilege check in tools/n2n-route */ -#include "wintap.h" #define SHUT_RDWR SD_BOTH /* for tcp */ #endif /* #ifdef _WIN32 */ diff --git a/include/n2n_wire.h b/include/n2n_wire.h index 0151bc984..037d67439 100644 --- a/include/n2n_wire.h +++ b/include/n2n_wire.h @@ -25,12 +25,10 @@ #include #endif -#ifdef _WIN32 -#include "n2n_win32.h" -#else /* #ifdef _WIN32 */ +#ifndef _WIN32 #include #include /* AF_INET and AF_INET6 */ -#endif /* #ifdef _WIN32 */ +#endif /* #ifndef _WIN32 */ #include "sn_selection.h" From 940cffd73feeac9bc2359ad78c303fae36984008 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 16:56:41 +0100 Subject: [PATCH 05/12] Dont require special build flags for just one header --- Makefile | 1 - include/n2n_typedefs.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index c4204e11b..2457a4371 100644 --- a/Makefile +++ b/Makefile @@ -153,7 +153,6 @@ LDLIBS+=-ln2n LDLIBS+=$(LDLIBS_EXTRA) ifeq ($(CONFIG_TARGET),mingw) -CFLAGS+=-I. -I./win32 LDLIBS+=$(abspath win32/n2n_win32.a) LDLIBS+=-lnetapi32 -lws2_32 -liphlpapi N2N_DEPS+=win32/n2n_win32.a diff --git a/include/n2n_typedefs.h b/include/n2n_typedefs.h index 0b34f32e6..303e1b433 100644 --- a/include/n2n_typedefs.h +++ b/include/n2n_typedefs.h @@ -52,8 +52,8 @@ typedef int ssize_t; typedef unsigned long in_addr_t; -#include "n2n_win32.h" -// FIXME - the above include is from a different subdir +#include "../win32/n2n_win32.h" +// FIXME - continue untangling the build and includes - dont have a ".." here #endif /* #if defined(_MSC_VER) || defined(__MINGW32__) */ From cc49266dd1ec865bef36955d71fa5a2dda15a63e Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 16:58:42 +0100 Subject: [PATCH 06/12] Move the special windows lib config into the configure script --- Makefile | 1 - configure.ac | 3 +++ scripts/hack_fakeautoconf.sh | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2457a4371..e1b9b0a22 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,6 @@ LDLIBS+=$(LDLIBS_EXTRA) ifeq ($(CONFIG_TARGET),mingw) LDLIBS+=$(abspath win32/n2n_win32.a) -LDLIBS+=-lnetapi32 -lws2_32 -liphlpapi N2N_DEPS+=win32/n2n_win32.a SUBDIRS+=win32 endif diff --git a/configure.ac b/configure.ac index f79d15432..641fdafef 100644 --- a/configure.ac +++ b/configure.ac @@ -18,6 +18,9 @@ case "$host_os" in # and comment "For OpenSolaris (Solaris too?)" LIBS="-lsocket -lnsl $LIBS" ;; + mingw*) + LIBS="-lnetapi32 -lws2_32 -liphlpapi $LIBS" + ;; esac # This replicates the old config logic from the Makefile. diff --git a/scripts/hack_fakeautoconf.sh b/scripts/hack_fakeautoconf.sh index 414c0c9e7..c36a93333 100755 --- a/scripts/hack_fakeautoconf.sh +++ b/scripts/hack_fakeautoconf.sh @@ -18,12 +18,15 @@ chmod a+x configure cat >config.mak <include/config.h From 2a92a5fb84583e7295831fee35115c8ec3e5e596 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 17:01:28 +0100 Subject: [PATCH 07/12] Refactor to use the host triplet instead of CONFIG_TARGET --- Makefile | 16 ++-------------- tools/Makefile | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index e1b9b0a22..5b345e05e 100644 --- a/Makefile +++ b/Makefile @@ -38,18 +38,6 @@ ifndef UNAME_S $(error Could not run uname command, cannot continue) endif -# Any compile environment that needs different flags, libraries, includes or -# other settings will get its own CONFIG_TARGET value. For cross compiling, -# this might be set externally to the Makefile, but if not set we try to -# set a reasonable default. - -export CONFIG_TARGET -ifndef CONFIG_TARGET -ifeq ($(shell uname -o),Msys) -CONFIG_TARGET=mingw -endif -endif - export MKDIR export INSTALL export INSTALL_PROG @@ -152,7 +140,7 @@ LINT_CCODE=\ LDLIBS+=-ln2n LDLIBS+=$(LDLIBS_EXTRA) -ifeq ($(CONFIG_TARGET),mingw) +ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) LDLIBS+=$(abspath win32/n2n_win32.a) N2N_DEPS+=win32/n2n_win32.a SUBDIRS+=win32 @@ -216,7 +204,7 @@ src/example_edge_embed_quick_edge_init: $(N2N_LIB) src/example_sn_embed: $(N2N_LIB) src/example_edge_embed: $(N2N_LIB) -ifeq ($(CONFIG_TARGET), mingw) +ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) src/edge: win32/edge_rc.o endif diff --git a/tools/Makefile b/tools/Makefile index 1de221c93..02fe68c9b 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -7,7 +7,7 @@ DEBUG?=-g3 HEADERS=$(wildcard include/*.h) CFLAGS+=-I../include -ifeq ($(CONFIG_TARGET),mingw) +ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) CFLAGS+=-I../win32 endif CFLAGS+=$(DEBUG) From 2a53ac438f10d85ef306e0d32a25108f3b53d3a0 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 17:11:12 +0100 Subject: [PATCH 08/12] Ensure library is included in correct order It looks to me that the correct way to address this build wrinkle is simply to add the win32 functions to the libn2n when building a win32 output, then there is no additional magic library juggling required for the win32 case --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5b345e05e..840a120dc 100644 --- a/Makefile +++ b/Makefile @@ -136,12 +136,13 @@ LINT_CCODE=\ tools/tests-transform.c \ tools/tests-wire.c \ - LDLIBS+=-ln2n +ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) +LDLIBS+=$(abspath win32/n2n_win32.a) +endif LDLIBS+=$(LDLIBS_EXTRA) ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) -LDLIBS+=$(abspath win32/n2n_win32.a) N2N_DEPS+=win32/n2n_win32.a SUBDIRS+=win32 endif From b35fff2e5ff87e54b5606272301b1a1d5fef5c63 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 17:40:11 +0100 Subject: [PATCH 09/12] 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 840a120dc..628b8fc80 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 29af36822..1ea0bfab2 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 641fdafef..05a18775d 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 02fe68c9b..96b6695bb 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: From c169d9404c760823488697ff9410aa2e22c2e3de Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 17:42:27 +0100 Subject: [PATCH 10/12] The arm64 build has now been tested on real hardware --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 82db48b4d..a07460b09 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -702,12 +702,12 @@ jobs: matrix: arch: - arm-linux-gnueabi + - aarch64-linux-gnu # I assume these architectures produce working code, but this has # not been directly confirmed. # They are compiled dynamically against normal libc, so will not # work on openwrt. - - aarch64-linux-gnu - mips-linux-gnu - mipsel-linux-gnu From fdf7dcbc8a7d0378d0976b0dbadfd03b716bb1ac Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 17:46:06 +0100 Subject: [PATCH 11/12] Add a cross-compiled 64bit windows build to CI --- .github/workflows/tests.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a07460b09..cb9d8718b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -700,16 +700,21 @@ jobs: strategy: fail-fast: true matrix: - arch: - - arm-linux-gnueabi - - aarch64-linux-gnu + include: + - arch: arm-linux-gnueabi + - arch: aarch64-linux-gnu + + # Unfortunately, the ubnuts mingw package names dont follow the + # same naming convention as every other cross-compiler. + - arch: x86_64-w64-mingw32 + package_suffix: mingw-w64-x86-64 # I assume these architectures produce working code, but this has # not been directly confirmed. # They are compiled dynamically against normal libc, so will not # work on openwrt. - - mips-linux-gnu - - mipsel-linux-gnu + - arch: mips-linux-gnu + - arch: mipsel-linux-gnu steps: - uses: actions/checkout@v3 @@ -724,8 +729,8 @@ jobs: run: | sudo apt-get update sudo apt-get install \ - binutils-${{ matrix.arch }} \ - gcc-${{ matrix.arch }} + binutils-${{ matrix.package_suffix || matrix.arch }} \ + gcc-${{ matrix.package_suffix || matrix.arch }} - name: Configure and Build shell: bash From f8bb96970df1015b6e5485375d61a150482ee6c1 Mon Sep 17 00:00:00 2001 From: Hamish Coleman Date: Sun, 2 Jul 2023 18:03:27 +0100 Subject: [PATCH 12/12] Hack around the "helpful" exe file suffix If there is a way to turn off the mingw insistence that it will rewrite the filename it was given in the "-o" options, I have not been able to find it. I could easily handle all the moves or renames at the end of the build process if I could turn off this feature. Especially since it means that make often thinks that the file has not been built (the filename that make knows about is not the file that actually gets built by the mingw gcc, so the if-newer tests that make applies will always fail) --- Makefile | 12 +++++++++--- tools/Makefile | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 628b8fc80..0d14421c7 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ export EXE export CFLAGS export LDFLAGS export LDLIBS +export CONFIG_HOST_OS -include config.mak @@ -208,6 +209,11 @@ src/example_edge_embed: $(N2N_LIB) ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) src/edge: win32/edge_rc.o +src/edge.exe: src/edge +src/supernode.exe: src/supernode +src/example_edge_embed_quick_edge_init.exe: src/example_edge_embed_quick_edge_init +src/example_sn_embed.exe: src/example_sn_embed +src/example_edge_embed.exe: src/example_edge_embed endif %: src/% @@ -300,11 +306,11 @@ distclean: rm -f $(addprefix src/,$(APPS)) .PHONY: install -install: edge supernode edge.8.gz supernode.1.gz n2n.7.gz +install: edge$(EXE) supernode$(EXE) edge.8.gz supernode.1.gz n2n.7.gz echo "MANDIR=$(MANDIR)" $(MKDIR) $(SBINDIR) $(MAN1DIR) $(MAN7DIR) $(MAN8DIR) - $(INSTALL_PROG) supernode $(SBINDIR)/ - $(INSTALL_PROG) edge $(SBINDIR)/ + $(INSTALL_PROG) supernode$(EXE) $(SBINDIR)/ + $(INSTALL_PROG) edge$(EXE) $(SBINDIR)/ $(INSTALL_DOC) edge.8.gz $(MAN8DIR)/ $(INSTALL_DOC) supernode.1.gz $(MAN1DIR)/ $(INSTALL_DOC) n2n.7.gz $(MAN7DIR)/ diff --git a/tools/Makefile b/tools/Makefile index 96b6695bb..08c4a7e59 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -37,9 +37,20 @@ n2n-route.o: $(N2N_LIB) $(HEADERS) ../config.mak n2n-portfwd.o: $(N2N_LIB) $(HEADERS) ../config.mak n2n-decode.o: $(N2N_LIB) $(HEADERS) ../config.mak +ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) # HACK for windows. -%.exe: % - cp $< $@ +n2n-benchmark.exe: n2n-benchmark +n2n-keygen.exe: n2n-keygen +n2n-route.exe: n2n-route +n2n-portfwd.exe: n2n-portfwd +n2n-decode.exe: n2n-decode +tests-compress.exe: tests-compress +tests-elliptic.exe: tests-elliptic +tests-hashing.exe: tests-hashing +tests-transform.exe: tests-transform +tests-wire.exe: tests-wire +tests-auth.exe: tests-auth +endif # See comments in the topdir Makefile about how to generate coverage # data.