From 84b6efe4b847f3211d93b3703e01b0e6c1eee375 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Sat, 21 Oct 2023 01:07:25 +0200 Subject: [PATCH] mingw: Build more shared device-connector libserver irpmon-server Signed-off-by: Tormod Volden --- Makefile | 23 +++++++++++++++-------- common.mk | 3 +-- device-connector/Makefile | 7 +++++++ irpmon-server/Makefile | 9 +++++++++ irpmonc/Makefile | 13 +++++++------ libserver/Makefile | 9 +++++++++ shared/Makefile | 7 +++++++ 7 files changed, 55 insertions(+), 16 deletions(-) create mode 100644 device-connector/Makefile create mode 100644 irpmon-server/Makefile create mode 100644 libserver/Makefile create mode 100644 shared/Makefile diff --git a/Makefile b/Makefile index b62babcc..18097b95 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,27 @@ -dlls = \ +depdirs = \ libcallbackstreamdll \ libdparserdll \ libreqlistdll \ libsymbolsdll \ - irpmondll + irpmondll \ + libserver -main = irpmonc +maindirs = irpmonc irpmon-server -.PHONY: all clean $(dlls) $(main) +otherdirs = device-connector shared -all: $(dlls) - $(MAKE) -C $(main) +.PHONY: all clean $(depdirs) $(maindirs) $(otherdirs) -$(dlls): +all: $(otherdirs) $(maindirs) + +$(maindirs): $(depdirs) + $(MAKE) -C $@ + +$(depdirs) $(otherdirs): $(MAKE) -C $@ +libserver: device-connector + clean: - $(foreach dir,$(dlls) $(main),$(MAKE) -C $(dir) $@ &&) : + $(foreach dir,$(depdirs) $(maindirs) $(otherdirs),$(MAKE) -C $(dir) $@ &&) : diff --git a/common.mk b/common.mk index 76b67e1f..fe80ce84 100644 --- a/common.mk +++ b/common.mk @@ -6,7 +6,6 @@ INCLUDES = -I/usr/share/mingw-w64/include INCLUDES += -I../include -I../shared CPPFLAGS += $(INCLUDES) -O2 CFLAGS += $(INCLUDES) -O2 -LDFLAGS += -municode CC = $(CROSS)gcc LD = $(CROSS)ld @@ -15,7 +14,7 @@ CXX = $(CROSS)g++ all: $(EXE) $(EXE): $(OBJS) - $(CXX) -o $@ $(LDFLAGS) $^ + $(CXX) -o $@ $(LDFLAGS) $^ $(LDLIBS) clean: rm -f $(EXE) $(OBJS) $(DELOBJS) diff --git a/device-connector/Makefile b/device-connector/Makefile new file mode 100644 index 00000000..57b17ee4 --- /dev/null +++ b/device-connector/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = device-connector.dll +OBJS = device-connector.o + +include ../common.mk diff --git a/irpmon-server/Makefile b/irpmon-server/Makefile new file mode 100644 index 00000000..89b04d71 --- /dev/null +++ b/irpmon-server/Makefile @@ -0,0 +1,9 @@ + +LDFLAGS += -L../libserver -mconsole +LDLIBS += -lserver + +EXE = server +OBJS = server.o +DELOBJS = $(EXE).exe + +include ../common.mk diff --git a/irpmonc/Makefile b/irpmonc/Makefile index e5cc1c81..5687908e 100644 --- a/irpmonc/Makefile +++ b/irpmonc/Makefile @@ -1,12 +1,13 @@ CPPFLAGS += -DNOVSOCKETS -LDFLAGS += \ - -L../irpmondll -lirpmondll \ - -L../libdparserdll -llibdparser \ - -L../libreqlistdll -llibreqlist \ - -L../libsymbolsdll -llibsymbols \ - -L../libcallbackstreamdll -lcallbackstream +LDFLAGS += -municode \ + -L../irpmondll -L../libdparserdll -L../libreqlistdll \ + -L../libsymbolsdll -L../libcallbackstreamdll + +LDLIBS += \ + -lirpmondll -llibdparser -llibreqlist \ + -llibsymbols -lcallbackstream EXE = irpmonc OBJS = driver-settings.o irpmonc.o guid-api.o stop-event.o diff --git a/libserver/Makefile b/libserver/Makefile new file mode 100644 index 00000000..d58f6e5c --- /dev/null +++ b/libserver/Makefile @@ -0,0 +1,9 @@ + +CFLAGS += -DNOVSOCKETS -D_WIN32_WINNT=0x0600 +LDFLAGS += -shared -L../device-connector +LDLIBS += -ldevice-connector -lws2_32 + +EXE = libserver.dll +OBJS = libserver.o + +include ../common.mk diff --git a/shared/Makefile b/shared/Makefile new file mode 100644 index 00000000..a02b8ff9 --- /dev/null +++ b/shared/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = request.dll +OBJS = request.o + +include ../common.mk