source: branches/client-3.0/src/Makefile.kmk@ 1036

Last change on this file since 1036 was 929, checked in by Paul Smedley, 9 years ago

make it build using Samba 4.4.x

  • Property svn:eol-style set to native
File size: 7.0 KB
Line 
1#
2# Netdrive Samba client plugin
3# kBuild makefile
4# Copyright (C) netlabs.org 2003-2008
5# See COPYING for license informations
6#
7# please define (as env variables or kmk command line) the following variables before starting:
8# BUILD_PLATFORM = os2
9# BUILD_TYPE = release|debug
10#
11# Copy Config.km_ to Config.kmk and edit it to match your installation.
12#
13
14DEPTH = ..
15
16ndpsmb_TOOL = GCC3OMF
17
18DLLS = ndpsmb
19
20# required to get IPFC compiler to work correctly
21export IPFC=$(TOOLKIT)\IPFC
22
23TOOL_GCC3OMF_RCFLAGS += -i=$(TOOLKIT)/h
24
25ndpsmb_SOURCES = \
26 rc/rc.rc \
27 ndpsmb.def \
28 ndpsmb.c \
29 debug.c \
30 util.c \
31 dircache.c \
32 smbwrp.c
33
34ndpsmb_CFLAGS = -Zomf
35# YD -O2/O3 triggers stack variable alignment bug in gcc 4.3.2/4.4.0!
36ndpsmb_CFLAGS.release = -g -O1 -march=pentium -mtune=pentium4
37
38ndpsmb_CFLAGS.debug = -g -O0
39ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll -Zhigh-mem
40ndpsmb_LDFLAGS.release = -s
41ndpsmb_LDFLAGS.debug = -g
42
43ndpsmb_DEFS = $(LIBSMB_THREAD_UNSAFE)
44ndpsmb_INCS = ./h ./rc \
45 $(SAMBA) \
46 $(SAMBA)/bin/default/include/public \
47 $(SAMBA)/bin/default/include \
48 $(SAMBA)/bin/default \
49 $(SAMBA)/source3 \
50 $(SAMBA)/source3/include \
51 $(SAMBA)/lib/replace \
52 $(SAMBA)/popt \
53 $(SAMBA)/lib/talloc \
54 $(SAMBA)/libcli \
55 $(SAMBA)/librpc \
56 $(SAMBA)/lib/tdb/include \
57 $(SAMBA)/lib/tevent
58
59ndpsmb_LIBS = $(SAMBA)/smbcln44.lib
60ndpsmb_LIBPATH = $(SAMBA)/source3/bin $(Z_LIBDIR)
61
62ndpsmb_CLEAN = rc/description.rc $(PATH_STAGE_LIB)/ndpsmb.dll
63
64#build other files (e.g. help)
65OTHER_CLEAN += $(PATH_INST_BIN)/en/ndpsmb.hlp $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/readme.txt \
66 $(PATH_INST_BIN)/fr/ndpsmb.hlp $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/readme_fr.txt \
67 $(PATH_INST_BIN)/de/ndpsmb.hlp $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/readme_de.txt
68
69# install some more files
70INSTALLS = ndpsmb-docs
71ndpsmb-docs_INST = $(INST_BIN)
72ndpsmb-docs_SOURCES = COPYING resources/ndpsmb.ndp resources/instpl.cmd resources/uninstpl.cmd
73
74OTHER_CLEAN += $(INST_BIN)/COPYING $(INST_BIN)/ndpsmb.ndp $(INST_BIN)/instpl.cmd $(INST_BIN)/uninstpl.cmd $(INST_BIN)/ndpsmb.dll $(PATH_OBJ)/ndpsmb.wis
75
76# packaging stuffs
77ifeq ($(BUILD_TYPE),debug)
78 PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug
79else
80 PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)
81endif
82PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
83PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
84OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
85OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
86
87# now include standard code
88include $(PATH_KBUILD)/rules.kMk
89
90# here follows standard gnu make inference rules
91
92# add new dependancy on build level info
93rc/rc.rc : rc/description.rc nversion.h rc/rc.rc_
94 $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" rc/rc.rc_ \
95 | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
96 | $(SED) "s;_BUILD_;$(BUILD);g" \
97 | $(SED) "s;_VENDOR_;$(VENDOR);g" \
98 > rc/rc.rc
99
100
101# update bldlevel info
102rc/description.rc: config.kmk
103 @echo Writing build level informations
104 @cp rc/description.rc_ rc/description.rc
105 $(QUIET)cmd /c 'BldLevelInf.cmd -V"$(VERSION)" -N"$(VENDOR)" -D"NDPSMB - SMBFS NetDrive External Plugin Build $(BUILD)" -Len rc\\description.rc'
106
107# compile help file
108$(PATH_INST_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf nversion.h Config.kmk ./help/changelog.txt
109 -@mkdir $(PATH_OBJ)
110 -@mkdir $(PATH_OBJ)\en
111 @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 /Define:en /Define:ipf
112 -@mkdir $(PATH_INST_BIN)
113 -@mkdir $(PATH_INST_BIN)\en
114 $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/en/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
115
116$(PATH_INST_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf nversion.h Config.kmk ./help/changelog.txt
117 -@mkdir $(PATH_OBJ)
118 -@mkdir $(PATH_OBJ)\fr
119 @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 /Define:fr /Define:ipf
120 -@mkdir $(PATH_INST_BIN)
121 -@mkdir $(PATH_INST_BIN)\fr
122 $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/fr/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
123
124$(PATH_INST_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf nversion.h Config.kmk ./help/changelog.txt
125 -@mkdir $(PATH_OBJ)
126 -@mkdir $(PATH_OBJ)\de
127 @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 /Define:de /Define:ipf
128 -@mkdir $(PATH_INST_BIN)
129 -@mkdir $(PATH_INST_BIN)\de
130 $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/de/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
131
132
133# substitute macros in nversion.h
134nversion.h: Config.kmk nversion.tpl
135 $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" nversion.tpl \
136 | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
137 | $(SED) "s;_BUILD_;$(BUILD);g" \
138 | $(SED) "s;_VENDOR_;$(VENDOR);g" \
139 > nversion.h
140
141# substitute macros in docs
142$(PATH_INST_BIN)/readme.txt: Config.kmk ./help/readme.txt nversion.h ./help/changelog.txt
143 @ppwizard.cmd ./help/readme.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme.txt /other /WarningsRc:0 /Define:en /Define:txt
144
145$(PATH_INST_BIN)/readme_fr.txt: Config.kmk ./help/readme_fr.txt nversion.h ./help/changelog.txt
146 @ppwizard.cmd ./help/readme_fr.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme_fr.txt /other /WarningsRc:0 /Define:fr /Define:txt
147
148$(PATH_INST_BIN)/readme_de.txt: Config.kmk ./help/readme_de.txt nversion.h ./help/changelog.txt
149 @ppwizard.cmd ./help/readme_de.txt /option:KeepIndent=On /option:LeaveBlankLines=On /Pack:N /output:$(PATH_INST_BIN)/readme_de.txt /other /WarningsRc:0 /Define:de /Define:txt
150
151
152# final: zip all files!
153$(PATH_OUT)/dist/$(PACKAGE_NAME).zip: \
154 $(PATH_INST_BIN)/instpl.cmd \
155 $(PATH_INST_BIN)/ndpsmb.ndp \
156 $(PATH_INST_BIN)/uninstpl.cmd \
157 $(PATH_INST_BIN)/ndpsmb.dll \
158 $(PATH_INST_BIN)/COPYING \
159 $(PATH_INST_BIN)/en/ndpsmb.hlp \
160 $(PATH_INST_BIN)/fr/ndpsmb.hlp \
161 $(PATH_INST_BIN)/de/ndpsmb.hlp \
162 $(PATH_INST_BIN)/readme.txt \
163 $(PATH_INST_BIN)/readme_fr.txt \
164 $(PATH_INST_BIN)/readme_de.txt
165 $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
166 $(QUIET)$(RM) -f $@
167 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- zip -9Sr $@ .
168
169
170# final2: wpi all files!
171$(PATH_OUT)/dist/$(PACKAGE_NAME).wpi: \
172 ./resources/ndpsmb.tpl \
173 $(PATH_INST_BIN)/instpl.cmd \
174 $(PATH_INST_BIN)/ndpsmb.ndp \
175 $(PATH_INST_BIN)/uninstpl.cmd \
176 $(PATH_INST_BIN)/ndpsmb.dll \
177 $(PATH_INST_BIN)/COPYING \
178 $(PATH_INST_BIN)/en/ndpsmb.hlp \
179 $(PATH_INST_BIN)/fr/ndpsmb.hlp \
180 $(PATH_INST_BIN)/de/ndpsmb.hlp \
181 $(PATH_INST_BIN)/readme.txt \
182 $(PATH_INST_BIN)/readme_fr.txt \
183 $(PATH_INST_BIN)/readme_de.txt
184 $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
185 $(QUIET)$(RM) -f $@
186 @ppwizard.cmd resources/ndpsmb.tpl /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0
187 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 2 -r ".\en\*.hlp"
188 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 3 -r ".\fr\*.hlp"
189 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 4 -r ".\de\*.hlp"
190 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -s $(subst /,\\,$(PATH_OBJ))\\ndpsmb.wis -a 1 "*"
Note: See TracBrowser for help on using the repository browser.