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

Last change on this file since 1036 was 817, checked in by Silvan Scherrer, 12 years ago

Samba Client 2.1: timestamp work and some backport from 2.2 client

  • 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 printf.c \
31 util.c \
32 dircache.c \
33 smbwrp.c
34
35ndpsmb_CFLAGS = -Zomf
36# YD -O2/O3 triggers stack variable alignment bug in gcc 4.3.2/4.4.0!
37ndpsmb_CFLAGS.release = -g -O1 -march=pentium -mtune=pentium4
38
39ndpsmb_CFLAGS.debug = -g -O0
40ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll
41ndpsmb_LDFLAGS.release = -s
42ndpsmb_LDFLAGS.debug = -g
43
44ndpsmb_DEFS = $(LIBSMB_THREAD_UNSAFE)
45ndpsmb_INCS = ./h ./rc \
46 $(SAMBA)/source \
47 $(SAMBA)/source/include \
48 $(SAMBA)/source/lib/replace \
49 $(SAMBA)/source/popt \
50 $(SAMBA)/source/lib/talloc \
51 $(SAMBA)/source/librpc \
52 $(SAMBA)/source/lib/tdb/include \
53 $(GCC_INC)
54
55ndpsmb_LIBS = libsmbclient.a socket.a
56ndpsmb_LIBS += $(GCC_LIB)/binmode.obj
57ndpsmb_LIBPATH = $(SAMBA)/source/bin
58
59ndpsmb_CLEAN = rc/description.rc $(PATH_STAGE_LIB)/ndpsmb.dll
60
61#build other files (e.g. help)
62OTHER_CLEAN += $(PATH_INST_BIN)/en/ndpsmb.hlp $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/readme.txt \
63 $(PATH_INST_BIN)/fr/ndpsmb.hlp $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/readme_fr.txt \
64 $(PATH_INST_BIN)/de/ndpsmb.hlp $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/readme_de.txt
65
66# install some more files
67INSTALLS = ndpsmb-docs
68ndpsmb-docs_INST = $(INST_BIN)
69ndpsmb-docs_SOURCES = COPYING resources/ndpsmb.ndp resources/instpl.cmd resources/uninstpl.cmd
70
71OTHER_CLEAN += $(INST_BIN)/COPYING $(INST_BIN)/ndpsmb.ndp $(INST_BIN)/instpl.cmd $(INST_BIN)/uninstpl.cmd $(INST_BIN)/ndpsmb.dll $(PATH_OBJ)/ndpsmb.wis
72
73# packaging stuffs
74ifeq ($(BUILD_TYPE),debug)
75 PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug
76else
77 PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)
78endif
79PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
80PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
81OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
82OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
83
84# now include standard code
85include $(PATH_KBUILD)/rules.kMk
86
87# here follows standard gnu make inference rules
88
89# add new dependancy on build level info
90rc/rc.rc : rc/description.rc nversion.h rc/rc.rc_
91 $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" rc/rc.rc_ \
92 | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
93 | $(SED) "s;_BUILD_;$(BUILD);g" \
94 | $(SED) "s;_VENDOR_;$(VENDOR);g" \
95 > rc/rc.rc
96
97
98# update bldlevel info
99rc/description.rc: config.kmk
100 @echo Writing build level informations
101 @cp rc/description.rc_ rc/description.rc
102 $(QUIET)cmd /c 'BldLevelInf.cmd -V"$(VERSION)" -N"$(VENDOR)" -D"NDPSMB - SMBFS NetDrive External Plugin Build $(BUILD)" -Len rc\\description.rc'
103
104# compile help file
105$(PATH_INST_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf nversion.h Config.kmk ./help/changelog.txt
106 -@mkdir $(PATH_OBJ)
107 -@mkdir $(PATH_OBJ)\en
108 @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 /Define:en /Define:ipf
109 -@mkdir $(PATH_INST_BIN)
110 -@mkdir $(PATH_INST_BIN)\en
111 $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/en/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
112
113$(PATH_INST_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf nversion.h Config.kmk ./help/changelog.txt
114 -@mkdir $(PATH_OBJ)
115 -@mkdir $(PATH_OBJ)\fr
116 @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 /Define:fr /Define:ipf
117 -@mkdir $(PATH_INST_BIN)
118 -@mkdir $(PATH_INST_BIN)\fr
119 $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/fr/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
120
121$(PATH_INST_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf nversion.h Config.kmk ./help/changelog.txt
122 -@mkdir $(PATH_OBJ)
123 -@mkdir $(PATH_OBJ)\de
124 @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 /Define:de /Define:ipf
125 -@mkdir $(PATH_INST_BIN)
126 -@mkdir $(PATH_INST_BIN)\de
127 $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/de/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
128
129
130# substitute macros in nversion.h
131nversion.h: Config.kmk nversion.tpl
132 $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" nversion.tpl \
133 | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
134 | $(SED) "s;_BUILD_;$(BUILD);g" \
135 | $(SED) "s;_VENDOR_;$(VENDOR);g" \
136 > nversion.h
137
138# substitute macros in docs
139$(PATH_INST_BIN)/readme.txt: Config.kmk ./help/readme.txt nversion.h ./help/changelog.txt
140 @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
141
142$(PATH_INST_BIN)/readme_fr.txt: Config.kmk ./help/readme_fr.txt nversion.h ./help/changelog.txt
143 @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
144
145$(PATH_INST_BIN)/readme_de.txt: Config.kmk ./help/readme_de.txt nversion.h ./help/changelog.txt
146 @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
147
148
149# final: zip all files!
150$(PATH_OUT)/dist/$(PACKAGE_NAME).zip: \
151 $(PATH_INST_BIN)/instpl.cmd \
152 $(PATH_INST_BIN)/ndpsmb.ndp \
153 $(PATH_INST_BIN)/uninstpl.cmd \
154 $(PATH_INST_BIN)/ndpsmb.dll \
155 $(PATH_INST_BIN)/COPYING \
156 $(PATH_INST_BIN)/en/ndpsmb.hlp \
157 $(PATH_INST_BIN)/fr/ndpsmb.hlp \
158 $(PATH_INST_BIN)/de/ndpsmb.hlp \
159 $(PATH_INST_BIN)/readme.txt \
160 $(PATH_INST_BIN)/readme_fr.txt \
161 $(PATH_INST_BIN)/readme_de.txt
162 $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
163 $(QUIET)$(RM) -f $@
164 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- zip -Sr9 $@ \*
165
166
167# final2: wpi all files!
168$(PATH_OUT)/dist/$(PACKAGE_NAME).wpi: \
169 ./resources/ndpsmb.tpl \
170 $(PATH_INST_BIN)/instpl.cmd \
171 $(PATH_INST_BIN)/ndpsmb.ndp \
172 $(PATH_INST_BIN)/uninstpl.cmd \
173 $(PATH_INST_BIN)/ndpsmb.dll \
174 $(PATH_INST_BIN)/COPYING \
175 $(PATH_INST_BIN)/en/ndpsmb.hlp \
176 $(PATH_INST_BIN)/fr/ndpsmb.hlp \
177 $(PATH_INST_BIN)/de/ndpsmb.hlp \
178 $(PATH_INST_BIN)/readme.txt \
179 $(PATH_INST_BIN)/readme_fr.txt \
180 $(PATH_INST_BIN)/readme_de.txt
181 $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
182 $(QUIET)$(RM) -f $@
183 @ppwizard.cmd resources/ndpsmb.tpl /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0
184 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 2 -r ".\en\*.hlp"
185 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 3 -r ".\fr\*.hlp"
186 $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 4 -r ".\de\*.hlp"
187 $(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.