From 280bedef0f542092bf2b29c8f59f332c91c6e4af Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Mon, 16 Oct 2023 22:44:30 +0200 Subject: [PATCH] Add makefiles for building irpmonc with MinGW Supports parallel building of the DLLs. For now without WMware vSockets. Signed-off-by: Tormod Volden --- Makefile | 20 ++++++++++++++++++++ common.mk | 21 +++++++++++++++++++++ irpmonc/Makefile | 15 +++++++++++++++ irpmondll/Makefile | 7 +++++++ libcallbackstreamdll/Makefile | 7 +++++++ libdparserdll/Makefile | 7 +++++++ libreqlistdll/Makefile | 7 +++++++ libsymbolsdll/Makefile | 7 +++++++ libvsock/Makefile | 7 +++++++ 9 files changed, 98 insertions(+) create mode 100644 Makefile create mode 100644 common.mk create mode 100644 irpmonc/Makefile create mode 100644 irpmondll/Makefile create mode 100644 libcallbackstreamdll/Makefile create mode 100644 libdparserdll/Makefile create mode 100644 libreqlistdll/Makefile create mode 100644 libsymbolsdll/Makefile create mode 100644 libvsock/Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..b62babcc --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ + +dlls = \ + libcallbackstreamdll \ + libdparserdll \ + libreqlistdll \ + libsymbolsdll \ + irpmondll + +main = irpmonc + +.PHONY: all clean $(dlls) $(main) + +all: $(dlls) + $(MAKE) -C $(main) + +$(dlls): + $(MAKE) -C $@ + +clean: + $(foreach dir,$(dlls) $(main),$(MAKE) -C $(dir) $@ &&) : diff --git a/common.mk b/common.mk new file mode 100644 index 00000000..76b67e1f --- /dev/null +++ b/common.mk @@ -0,0 +1,21 @@ + +# for cross-building with MinGW +CROSS = x86_64-w64-mingw32- +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 +CXX = $(CROSS)g++ + +all: $(EXE) + +$(EXE): $(OBJS) + $(CXX) -o $@ $(LDFLAGS) $^ + +clean: + rm -f $(EXE) $(OBJS) $(DELOBJS) diff --git a/irpmonc/Makefile b/irpmonc/Makefile new file mode 100644 index 00000000..4955e67c --- /dev/null +++ b/irpmonc/Makefile @@ -0,0 +1,15 @@ + +CPPFLAGS += -DNOVSOCKETS + +LDFLAGS += \ + -L../irpmondll -lirpmondll \ + -L../libdparserdll -ldparser \ + -L../libreqlistdll -lreqlist \ + -L../libsymbolsdll -lsymbols \ + -L../libcallbackstreamdll -lcallbackstream + +EXE = irpmonc +OBJS = driver-settings.o irpmonc.o guid-api.o stop-event.o +DELOBJS = $(EXE).exe + +include ../common.mk diff --git a/irpmondll/Makefile b/irpmondll/Makefile new file mode 100644 index 00000000..72fe1672 --- /dev/null +++ b/irpmondll/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = irpmondll.dll +OBJS = driver-com.o main.o + +include ../common.mk diff --git a/libcallbackstreamdll/Makefile b/libcallbackstreamdll/Makefile new file mode 100644 index 00000000..f4262bc0 --- /dev/null +++ b/libcallbackstreamdll/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = callbackstream.dll +OBJS = callback-stream.o + +include ../common.mk diff --git a/libdparserdll/Makefile b/libdparserdll/Makefile new file mode 100644 index 00000000..b3a0c624 --- /dev/null +++ b/libdparserdll/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = dparser.dll +OBJS = dparser.o + +include ../common.mk diff --git a/libreqlistdll/Makefile b/libreqlistdll/Makefile new file mode 100644 index 00000000..422fb014 --- /dev/null +++ b/libreqlistdll/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = reqlist.dll +OBJS = reqlist.o + +include ../common.mk diff --git a/libsymbolsdll/Makefile b/libsymbolsdll/Makefile new file mode 100644 index 00000000..4c4ac2e6 --- /dev/null +++ b/libsymbolsdll/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = symbols.dll +OBJS = symbols.o + +include ../common.mk diff --git a/libvsock/Makefile b/libvsock/Makefile new file mode 100644 index 00000000..5003ac2d --- /dev/null +++ b/libvsock/Makefile @@ -0,0 +1,7 @@ + +LDFLAGS += -shared + +EXE = libvsock.dll +OBJS = libvsock.o + +include ../common.mk