Reworked WIN32 Code
[olsrd.git] / make / Makefile.win32
1 #
2 # WINDOWS32 SPECIFIC CONFIGURATION
3 #
4
5 DESTDIR ?=
6 EXENAME = olsrd.exe
7
8 SRCS +=         $(wildcard src/win32/*.c)
9 HDRS +=         $(wildcard src/win32/*.h)
10
11 CPPFLAGS +=     -DWIN32 -D_WIN32_WINNT=0x0600
12 LIBS +=         -mno-cygwin -lws2_32 -liphlpapi
13 CPPFLAGS +=     -I$(TOPDIR)/src/win32
14 CFLAGS +=       -mno-cygwin
15
16 PLUGIN_FULLNAME ?= $(PLUGIN_NAME).dll
17 INSTALL_LIB =   cp $(PLUGIN_FULLNAME) ../..
18
19 ifdef OLSRD_PLUGIN
20 LDFLAGS +=      -L$(TOPDIR)
21 #LIBS +=        $(TOPDIR)/src/win32/compat.o
22 LIBS +=         -lolsrd
23 endif
24
25 OS_LIB_PTHREAD =
26 OS_CFLAG_PTHREAD =
27 OS_LIB_DYNLOAD =
28
29 win32lib: gui/win32/Main/olsrd_cfgparser.lib
30
31 gui/win32/Main/olsrd_cfgparser.lib: cfgparser
32                 @# Using the cygwin dlltool does not work (missing functions hooks)
33                 @# dlltool --input-def src/cfgparser/olsrd_cfgparser.def --dllname src/cfgparser/olsrd_cfgparser.dll --output-lib $@
34                 @# Use the Microsoft Lib Tool instead
35                 lib /machine:i386 /def:src/cfgparser/olsrd_cfgparser.def /out:gui/win32/Main/olsrd_cfgparser.lib
36
37 olsr-$(VERS).zip: gui/win32/release/Main.exe \
38                 gui/win32/release/Shim.exe \
39                 olsrd.exe \
40                 olsr_switch.exe \
41                 src/cfgparser/olsrd_cfgparser.dll \
42                 README \
43                 README-Link-Quality.html \
44                 README-Link-Quality-Fish-Eye.txt \
45                 README-Olsr-Switch.html \
46                 gui/win32/Inst/linux-manual.txt \
47                 files/olsrd.conf.win32.rfc \
48                 files/olsrd.conf.win32.lq \
49                 gui/win32/Main/RFC-Default.olsr \
50                 gui/win32/Main/LQ-Default.olsr \
51                 lib/dot_draw/olsrd_dot_draw.dll \
52                 lib/httpinfo/olsrd_httpinfo.dll
53                 $(STRIP) olsrd.exe
54                 $(STRIP) olsr_switch.exe
55                 $(STRIP) src/cfgparser/olsrd_cfgparser.dll
56                 $(STRIP) lib/dot_draw/olsrd_dot_draw.dll
57                 $(STRIP) lib/httpinfo/olsrd_httpinfo.dll
58                 rm -rf $(TEMP)/olsr-$(VERS)
59                 rm -f $(TEMP)/olsr-$(VERS).zip
60                 rm -f olsr-$(VERS).zip
61                 mkdir $(TEMP)/olsr-$(VERS)
62                 cp gui/win32/release/Main.exe $(TEMP)/olsr-$(VERS)/Switch.exe
63                 cp gui/win32/release/Shim.exe $(TEMP)/olsr-$(VERS)
64                 cp olsrd.exe $(TEMP)/olsr-$(VERS)
65                 cp olsr_switch.exe $(TEMP)/olsr-$(VERS)
66                 cp src/cfgparser/olsrd_cfgparser.dll $(TEMP)/olsr-$(VERS)
67                 cp README $(TEMP)/olsr-$(VERS)
68                 cp README-Link-Quality.html $(TEMP)/olsr-$(VERS)
69                 cp README-Link-Quality-Fish-Eye.txt $(TEMP)/olsr-$(VERS)
70                 cp README-Olsr-Switch.html $(TEMP)/olsr-$(VERS)
71                 cp gui/win32/Inst/linux-manual.txt $(TEMP)/olsr-$(VERS)
72                 cp files/olsrd.conf.win32.rfc $(TEMP)/olsr-$(VERS)/olsrd.conf.rfc
73                 cp files/olsrd.conf.win32.lq $(TEMP)/olsr-$(VERS)/olsrd.conf.lq
74                 cp gui/win32/Main/RFC-Default.olsr $(TEMP)/olsr-$(VERS)
75                 cp gui/win32/Main/LQ-Default.olsr $(TEMP)/olsr-$(VERS)/Default.olsr
76                 cp lib/dot_draw/olsrd_dot_draw.dll $(TEMP)/olsr-$(VERS)
77                 cp lib/httpinfo/olsrd_httpinfo.dll $(TEMP)/olsr-$(VERS)
78                 echo y | cacls $(TEMP)\olsr-$(VERS) /T /G Everyone:F
79                 cd "$(TEMP)"; zip -q -r olsr-$(VERS).zip olsr-$(VERS)
80                 cp $(TEMP)/olsr-$(VERS).zip .
81                 rm -rf $(TEMP)/olsr-$(VERS)
82                 rm -f $(TEMP)/olsr-$(VERS).zip
83
84 olsr-$(VERS)-setup.exe: gui/win32/release/Main.exe \
85                 gui/win32/release/Shim.exe \
86                 olsrd.exe \
87                 olsr_switch.exe \
88                 src/cfgparser/olsrd_cfgparser.dll \
89                 README \
90                 README-Link-Quality.html \
91                 README-Link-Quality-Fish-Eye.txt \
92                 README-Olsr-Switch.html \
93                 gui/win32/Inst/linux-manual.txt \
94                 files/olsrd.conf.win32.rfc \
95                 files/olsrd.conf.win32.lq \
96                 gui/win32/Main/RFC-Default.olsr \
97                 gui/win32/Main/LQ-Default.olsr \
98                 lib/dot_draw/olsrd_dot_draw.dll \
99                 lib/httpinfo/olsrd_httpinfo.dll \
100                 gui/win32/Inst/installer.nsi
101                 $(STRIP) olsrd.exe
102                 $(STRIP) olsr_switch.exe
103                 $(STRIP) src/cfgparser/olsrd_cfgparser.dll
104                 $(STRIP) lib/dot_draw/olsrd_dot_draw.dll
105                 $(STRIP) lib/nameservice/olsrd_nameservice.dll
106                 $(STRIP) lib/httpinfo/olsrd_httpinfo.dll
107                 rm -f olsr-setup.exe
108                 rm -f olsr-$(VERS)-setup.exe
109                 C:/Program\ Files/NSIS/makensis gui\win32\Inst\installer.nsi
110                 mv olsr-setup.exe olsr-$(VERS)-setup.exe
111
112 # Local Variables:
113 # mode: makefile
114 # End: