2 # WINDOWS32 SPECIFIC CONFIGURATION
8 SRCS += $(wildcard src/win32/*.c)
9 HDRS += $(wildcard src/win32/*.h)
11 CPPFLAGS += -DWIN32 -D_WIN32_WINNT=0x0600
12 LIBS += -mno-cygwin -lws2_32 -liphlpapi
13 CPPFLAGS += -I$(TOPDIR)/src/win32
16 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).dll
17 INSTALL_LIB = cp $(PLUGIN_FULLNAME) ../..
20 LDFLAGS += -L$(TOPDIR)
21 #LIBS += $(TOPDIR)/src/win32/compat.o
29 PROGDIR = c:/Programme
30 PROGCYG = /cygdrive/c/Programme
31 PSDKDIR = $(PROGDIR)/Microsoft SDK
32 PSDKCYG = $(PROGCYG)/Microsoft\ SDK
33 MSVCDIR = $(PROGDIR)/Microsoft Visual Studio
34 MSVCCYG = $(PROGCYG)/Microsoft\ Visual\ Studio
35 NSISDIR = $(PROGDIR)/NSIS
36 NSISCYG = $(PROGCYG)/NSIS
38 # Necessary for running cygwin under wine. Both the "-C" option and MAKELEVEL will oops...
39 MAKE := sh -c 'cmd=$$0;while [ 0 -lt $$\# ];do case $$1 in -C) cmd="cd $$2 && $$cmd";shift 2;; *) cmd="$$cmd \"$$1\"";shift;;esac;done;sh -c "export MAKELEVEL=0 && $$cmd"' $(MAKE)
41 gui/win32/Shim/Release/shim.obj: gui/win32/Shim/shim.c
42 test -d $(dir $@) || mkdir -p $(dir $@)
43 $(MSVCCYG)/VC98/Bin/CL.EXE \
44 /I"$(PSDKDIR)/Include" /I"$(MSVCDIR)/VC98/Include" \
45 /nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" \
46 /Fp"$(dir $@)/Shim.pch" /YX /Fo"$(dir $@)/" /Fd"$(dir $@)/" /FD /c "$<"
48 gui/win32/Shim/Release/Shim.exe: gui/win32/Shim/Release/shim.obj
49 $(MSVCCYG)/VC98/Bin/LINK.EXE \
50 /LIBPATH:"$(PSDKDIR)/Lib" /LIBPATH:"$(MSVCDIR)/VC98/Lib" \
51 kernel32.lib user32.lib \
52 /nologo /subsystem:console /incremental:no /machine:I386 /out:"$@" "$^"
55 WIN32FILES+=FrontendDlg
69 WIN32CPPFILES=$(addprefix gui/win32/Main/, $(addsuffix .cpp, $(WIN32FILES)))
70 WIN32OBJFILES=$(addprefix gui/win32/Main/Release/, $(addsuffix .obj, $(WIN32FILES)))
72 gui/win32/Main/Release/Frontend.res: gui/win32/Main/Frontend.rc
73 test -d $(dir $@) || mkdir -p $(dir $@)
74 $(PSDKCYG)/Bin/RC.Exe /l 0x407 /i"$(PSDKDIR)/Include" /i"$(MSVCDIR)/VC98/MFC/Include" /fo"$@" /d NDEBUG $<
76 gui/win32/Main/Release/Switch.exe: gui/win32/Main/olsrd_cfgparser.lib gui/win32/Main/Release/Frontend.res $(WIN32CPPFILES)
77 test -d $(dir $@) || mkdir -p $(dir $@)
78 $(MSVCCYG)/VC98/Bin/CL.EXE \
79 /I"$(PSDKDIR)/Include" /I"$(MSVCDIR)/VC98/Include" /I"$(MSVCDIR)/VC98/MFC/Include" /I"src" \
80 /nologo /MT /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" \
81 /Fp"$(dir $@)/Frontend.pch" /YX"stdafx.h" /Fo"$(dir $@)/" /Fd"$(dir $@)/" /FD /c \
83 $(MSVCCYG)/VC98/Bin/LINK.EXE \
84 /LIBPATH:"$(PSDKDIR)/Lib" /LIBPATH:"$(MSVCDIR)/VC98/Lib" /LIBPATH:"$(MSVCDIR)/VC98/MFC/Lib" \
85 ws2_32.lib iphlpapi.lib \
86 gui/win32/Main/olsrd_cfgparser.lib gui/win32/Main/Release/Frontend.res \
87 /nologo /subsystem:windows /incremental:no /machine:I386 /out:"$@" \
90 win32setup: gui/win32/Inst/installer.nsi gui/win32/Shim/Release/Shim.exe gui/win32/Main/Release/Switch.exe
91 $(NSISCYG)/makensis.exe $<
93 win32lib: gui/win32/Main/olsrd_cfgparser.lib
95 gui/win32/Main/olsrd_cfgparser.lib: cfgparser
96 @# Using the cygwin dlltool does not work (missing functions hooks)
97 @# dlltool --input-def src/cfgparser/olsrd_cfgparser.def --dllname src/cfgparser/olsrd_cfgparser.dll --output-lib $@
98 @# Use the Microsoft Lib Tool instead
99 $(MSVCCYG)/VC98/Bin/LIB.EXE /machine:i386 /def:src/cfgparser/olsrd_cfgparser.def /out:gui/win32/Main/olsrd_cfgparser.lib