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