Skip to content

Commit

Permalink
Add makefiles for building irpmonc with MinGW
Browse files Browse the repository at this point in the history
Supports parallel building of the DLLs.

For now without WMware vSockets.

Signed-off-by: Tormod Volden <[email protected]>
  • Loading branch information
tormodvolden committed Oct 16, 2023
1 parent 6cb5fd6 commit 8d6ad7c
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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) $@ &&) :
21 changes: 21 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
@@ -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)
15 changes: 15 additions & 0 deletions irpmonc/Makefile
Original file line number Diff line number Diff line change
@@ -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
7 changes: 7 additions & 0 deletions irpmondll/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

LDFLAGS += -shared

EXE = irpmondll.dll
OBJS = driver-com.o main.o

include ../common.mk
7 changes: 7 additions & 0 deletions libcallbackstreamdll/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

LDFLAGS += -shared

EXE = libcallbackstream.dll
OBJS = callback-stream.o

include ../common.mk
7 changes: 7 additions & 0 deletions libdparserdll/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

LDFLAGS += -shared

EXE = libdparser.dll
OBJS = dparser.o

include ../common.mk
7 changes: 7 additions & 0 deletions libreqlistdll/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

LDFLAGS += -shared

EXE = libreqlist.dll
OBJS = reqlist.o

include ../common.mk
7 changes: 7 additions & 0 deletions libsymbolsdll/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

LDFLAGS += -shared

EXE = libsymbols.dll
OBJS = symbols.o

include ../common.mk
7 changes: 7 additions & 0 deletions libvsock/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

LDFLAGS += -shared

EXE = libvsock.dll
OBJS = libvsock.o

include ../common.mk

0 comments on commit 8d6ad7c

Please sign in to comment.