Browse Source

Simplify win32 build process

When building on win32 systems, simply add the win32 specific functions
to the libn2n.a, which simplifies the commands needed.

By moving the win32 source code into the src directory, the source code
is better consolidated.
pull/1142/head
Hamish Coleman 1 year ago
parent
commit
83078c8104
  1. 26
      Makefile
  2. 2
      include/n2n_typedefs.h
  3. 0
      src/win32/DotNet/n2n.sln
  4. 0
      src/win32/DotNet/n2n.suo
  5. 0
      src/win32/DotNet/n2n.vcproj
  6. 0
      src/win32/DotNet/supernode.vcproj
  7. 0
      src/win32/edge.manifest
  8. 0
      src/win32/edge.rc
  9. 0
      src/win32/getopt.c
  10. 0
      src/win32/getopt.h
  11. 0
      src/win32/getopt1.c
  12. 0
      src/win32/n2n_win32.h
  13. 0
      src/win32/wintap.c
  14. 0
      src/win32/wintap.h
  15. 3
      tools/Makefile
  16. 19
      win32/Makefile

26
Makefile

@ -139,16 +139,8 @@ LINT_CCODE=\
tools/tests-wire.c \ tools/tests-wire.c \
LDLIBS+=-ln2n LDLIBS+=-ln2n
ifneq (,$(findstring mingw,$(CONFIG_HOST_OS)))
LDLIBS+=$(abspath win32/n2n_win32.a)
endif
LDLIBS+=$(LDLIBS_EXTRA) LDLIBS+=$(LDLIBS_EXTRA)
ifneq (,$(findstring mingw,$(CONFIG_HOST_OS)))
N2N_DEPS+=win32/n2n_win32.a
SUBDIRS+=win32
endif
APPS=edge$(EXE) APPS=edge$(EXE)
APPS+=supernode$(EXE) APPS+=supernode$(EXE)
APPS+=example_edge_embed_quick_edge_init$(EXE) APPS+=example_edge_embed_quick_edge_init$(EXE)
@ -189,12 +181,6 @@ version:
tools: $(N2N_LIB) tools: $(N2N_LIB)
$(MAKE) -C $@ $(MAKE) -C $@
win32:
$(MAKE) -C $@
win32/edge_rc.o: win32/edge.rc win32/edge.manifest
$(WINDRES) win32/edge.rc -O coff -o win32/edge_rc.o
src/edge.o: $(N2N_DEPS) src/edge.o: $(N2N_DEPS)
src/supernode.o: $(N2N_DEPS) src/supernode.o: $(N2N_DEPS)
src/example_edge_embed_quick_edge_init.o: $(N2N_DEPS) src/example_edge_embed_quick_edge_init.o: $(N2N_DEPS)
@ -208,7 +194,15 @@ src/example_sn_embed: $(N2N_LIB)
src/example_edge_embed: $(N2N_LIB) src/example_edge_embed: $(N2N_LIB)
ifneq (,$(findstring mingw,$(CONFIG_HOST_OS))) ifneq (,$(findstring mingw,$(CONFIG_HOST_OS)))
src/edge: win32/edge_rc.o N2N_OBJS+=src/win32/getopt1.o
N2N_OBJS+=src/win32/getopt.o
N2N_OBJS+=src/win32/wintap.o
src/win32/edge.rc: src/win32/edge.manifest
src/win32/edge_rc.o: src/win32/edge.rc
$(WINDRES) $< -O coff -o $@
src/edge: src/win32/edge_rc.o
src/edge.exe: src/edge src/edge.exe: src/edge
src/supernode.exe: src/supernode src/supernode.exe: src/supernode
src/example_edge_embed_quick_edge_init.exe: src/example_edge_embed_quick_edge_init src/example_edge_embed_quick_edge_init.exe: src/example_edge_embed_quick_edge_init
@ -226,8 +220,6 @@ $(N2N_LIB): $(N2N_OBJS)
$(AR) rcs $(N2N_LIB) $(N2N_OBJS) $(AR) rcs $(N2N_LIB) $(N2N_OBJS)
# $(RANLIB) $@ # $(RANLIB) $@
win32/n2n_win32.a: win32
.PHONY: test test.units test.integration .PHONY: test test.units test.integration
test: test.units test.integration test: test.units test.integration

2
include/n2n_typedefs.h

@ -52,7 +52,7 @@ typedef int ssize_t;
typedef unsigned long in_addr_t; typedef unsigned long in_addr_t;
#include "../win32/n2n_win32.h" #include "../src/win32/n2n_win32.h"
// FIXME - continue untangling the build and includes - dont have a ".." here // FIXME - continue untangling the build and includes - dont have a ".." here
#endif /* #if defined(_MSC_VER) || defined(__MINGW32__) */ #endif /* #if defined(_MSC_VER) || defined(__MINGW32__) */

0
win32/DotNet/n2n.sln → src/win32/DotNet/n2n.sln

0
win32/DotNet/n2n.suo → src/win32/DotNet/n2n.suo

0
win32/DotNet/n2n.vcproj → src/win32/DotNet/n2n.vcproj

0
win32/DotNet/supernode.vcproj → src/win32/DotNet/supernode.vcproj

0
win32/edge.manifest → src/win32/edge.manifest

0
win32/edge.rc → src/win32/edge.rc

0
win32/getopt.c → src/win32/getopt.c

0
win32/getopt.h → src/win32/getopt.h

0
win32/getopt1.c → src/win32/getopt1.c

0
win32/n2n_win32.h → src/win32/n2n_win32.h

0
win32/wintap.c → src/win32/wintap.c

0
win32/wintap.h → src/win32/wintap.h

3
tools/Makefile

@ -7,9 +7,6 @@ DEBUG?=-g3
HEADERS=$(wildcard include/*.h) HEADERS=$(wildcard include/*.h)
CFLAGS+=-I../include CFLAGS+=-I../include
ifneq (,$(findstring mingw,$(CONFIG_HOST_OS)))
CFLAGS+=-I../win32
endif
CFLAGS+=$(DEBUG) CFLAGS+=$(DEBUG)
LDFLAGS+=-L.. LDFLAGS+=-L..

19
win32/Makefile

@ -1,19 +0,0 @@
#
# This is not a standalone makefile, it must be called from the toplevel
# makefile to inherit the correct environment
CFLAGS+=-I../include -I.
LDFLAGS+=-L..
.PHONY: all clean install
all: n2n_win32.a
n2n_win32.a: getopt1.o getopt.o wintap.o
$(AR) rcs $@ $+
clean:
rm -rf n2n_win32.a *.o *.gcno *.gcda
install:
true
Loading…
Cancel
Save