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 |
|
---|
14 | DEPTH = ..
|
---|
15 |
|
---|
16 | ndpsmb_TOOL = GCC3OMF
|
---|
17 | ndpsmb_RCTOOL = OPENWATCOM
|
---|
18 |
|
---|
19 | DLLS = ndpsmb
|
---|
20 |
|
---|
21 | # required to get IPFC compiler to work correctly
|
---|
22 | export IPFC=$(TOOLKIT)\IPFC
|
---|
23 |
|
---|
24 | ndpsmb_RCTOOL =OPENWATCOM
|
---|
25 | TOOL_OPENWATCOM_RCFLAGS += -i=$(TOOLKIT)/h
|
---|
26 |
|
---|
27 | ndpsmb_SOURCES = \
|
---|
28 | rc/rc.rc \
|
---|
29 | ndpsmb.def \
|
---|
30 | ndpsmb.c \
|
---|
31 | debug.c \
|
---|
32 | printf.c \
|
---|
33 | util.c \
|
---|
34 | dircache.c \
|
---|
35 | smbwrp.c
|
---|
36 |
|
---|
37 | ndpsmb_CFLAGS = -Zomf
|
---|
38 | # YD -O2/O3 triggers stack variable alignment bug in gcc 4.3.2/4.4.0!
|
---|
39 | ndpsmb_CFLAGS.release = -g -O1 -march=pentium -mtune=pentium4
|
---|
40 |
|
---|
41 | ndpsmb_CFLAGS.debug = -g -O0 -DDEBUG_PRINTF
|
---|
42 | ndpsmb_LDFLAGS = -Zomf -Zno-fork -Zmap -Zdll -Zhigh-mem
|
---|
43 | ndpsmb_LDFLAGS.release = -s
|
---|
44 | ndpsmb_LDFLAGS.debug = -g
|
---|
45 |
|
---|
46 | ndpsmb_DEFS = $(LIBSMB_THREAD_UNSAFE)
|
---|
47 | ndpsmb_INCS = ./h ./rc \
|
---|
48 | $(SAMBA) \
|
---|
49 | $(SAMBA)/source3 \
|
---|
50 | $(SAMBA)/source3/include \
|
---|
51 | $(SAMBA)/lib/replace \
|
---|
52 | $(SAMBA)/popt \
|
---|
53 | $(SAMBA)/lib/talloc \
|
---|
54 | $(SAMBA)/librpc \
|
---|
55 | $(SAMBA)/lib/tdb/include \
|
---|
56 | $(SAMBA)/lib/tevent
|
---|
57 |
|
---|
58 | ndpsmb_LIBS = libsmbclient.a socket.a libtalloc.a libtdb.a libwbclient.a z
|
---|
59 | ndpsmb_LIBS += $(GCC_LIB)/binmode.obj
|
---|
60 | ndpsmb_LIBPATH = $(SAMBA)/source3/bin $(Z_LIBDIR)
|
---|
61 |
|
---|
62 | ndpsmb_CLEAN = rc/description.rc $(PATH_STAGE_LIB)/ndpsmb.dll
|
---|
63 |
|
---|
64 | #build other files (e.g. help)
|
---|
65 | OTHER_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
|
---|
70 | INSTALLS = ndpsmb-docs
|
---|
71 | ndpsmb-docs_INST = $(INST_BIN)
|
---|
72 | ndpsmb-docs_SOURCES = COPYING resources/ndpsmb.ndp resources/instpl.cmd resources/uninstpl.cmd
|
---|
73 |
|
---|
74 | OTHER_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
|
---|
77 | ifeq ($(BUILD_TYPE),debug)
|
---|
78 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)-debug
|
---|
79 | else
|
---|
80 | PACKAGE_NAME = ndpsmb-$(subst .,_,$(VERSION))-$(BUILD)
|
---|
81 | endif
|
---|
82 | PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
|
---|
83 | PACKING += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
|
---|
84 | OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).zip
|
---|
85 | OTHER_CLEAN += $(PATH_OUT)/dist/$(PACKAGE_NAME).wpi
|
---|
86 |
|
---|
87 | # now include standard code
|
---|
88 | include $(PATH_KBUILD)/rules.kMk
|
---|
89 |
|
---|
90 | # here follows standard gnu make inference rules
|
---|
91 |
|
---|
92 | # add new dependancy on build level info
|
---|
93 | rc/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 | > rc/rc.rc
|
---|
98 |
|
---|
99 |
|
---|
100 | # update bldlevel info
|
---|
101 | rc/description.rc: config.kmk
|
---|
102 | @echo Writing build level informations
|
---|
103 | @cp rc/description.rc_ rc/description.rc
|
---|
104 | @BldLevelInf0.cmd $(VERSION) $(BUILD)
|
---|
105 |
|
---|
106 | # compile help file
|
---|
107 | $(PATH_INST_BIN)/en/ndpsmb.hlp: ./help/ndpsmb.ipf nversion.h Config.kmk ./help/changelog.txt
|
---|
108 | -@mkdir $(PATH_OBJ)
|
---|
109 | -@mkdir $(PATH_OBJ)\en
|
---|
110 | @ppwizard.cmd ./help/ndpsmb.ipf /Pack:N /output:$(PATH_OBJ)/en/ndpsmb.ipf /other /WarningsRc:0 /Define:en /Define:ipf
|
---|
111 | -@mkdir $(PATH_INST_BIN)
|
---|
112 | -@mkdir $(PATH_INST_BIN)\en
|
---|
113 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/en/ndpsmb.ipf $(PATH_INST_BIN)/en/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
114 |
|
---|
115 | $(PATH_INST_BIN)/fr/ndpsmb.hlp: ./help/ndpsmb_fr.ipf nversion.h Config.kmk ./help/changelog.txt
|
---|
116 | -@mkdir $(PATH_OBJ)
|
---|
117 | -@mkdir $(PATH_OBJ)\fr
|
---|
118 | @ppwizard.cmd ./help/ndpsmb_fr.ipf /Pack:N /output:$(PATH_OBJ)/fr/ndpsmb.ipf /other /WarningsRc:0 /Define:fr /Define:ipf
|
---|
119 | -@mkdir $(PATH_INST_BIN)
|
---|
120 | -@mkdir $(PATH_INST_BIN)\fr
|
---|
121 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/fr/ndpsmb.ipf $(PATH_INST_BIN)/fr/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
122 |
|
---|
123 | $(PATH_INST_BIN)/de/ndpsmb.hlp: ./help/ndpsmb_de.ipf nversion.h Config.kmk ./help/changelog.txt
|
---|
124 | -@mkdir $(PATH_OBJ)
|
---|
125 | -@mkdir $(PATH_OBJ)\de
|
---|
126 | @ppwizard.cmd ./help/ndpsmb_de.ipf /Pack:N /output:$(PATH_OBJ)/de/ndpsmb.ipf /other /WarningsRc:0 /Define:de /Define:ipf
|
---|
127 | -@mkdir $(PATH_INST_BIN)
|
---|
128 | -@mkdir $(PATH_INST_BIN)\de
|
---|
129 | $(TOOLKIT)\bin\ipfc.exe $(PATH_OBJ)/de/ndpsmb.ipf $(PATH_INST_BIN)/de/ndpsmb.hlp /COUNTRY=001 /CODEPAGE=850
|
---|
130 |
|
---|
131 |
|
---|
132 | # substitute macros in nversion.h
|
---|
133 | nversion.h: Config.kmk nversion.tpl
|
---|
134 | $(QUIET)$(SED) "s;_VERSION_;$(VERSION);g" nversion.tpl \
|
---|
135 | | $(SED) "s;_WPIVERSION_;$(subst .,\\\,$(VERSION));g" \
|
---|
136 | | $(SED) "s;_BUILD_;$(BUILD);g" \
|
---|
137 | > nversion.h
|
---|
138 |
|
---|
139 | # substitute macros in docs
|
---|
140 | $(PATH_INST_BIN)/readme.txt: Config.kmk ./help/readme.txt nversion.h ./help/changelog.txt
|
---|
141 | @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
|
---|
142 |
|
---|
143 | $(PATH_INST_BIN)/readme_fr.txt: Config.kmk ./help/readme_fr.txt nversion.h ./help/changelog.txt
|
---|
144 | @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
|
---|
145 |
|
---|
146 | $(PATH_INST_BIN)/readme_de.txt: Config.kmk ./help/readme_de.txt nversion.h ./help/changelog.txt
|
---|
147 | @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
|
---|
148 |
|
---|
149 | # copy ndpsmb.dll to the bin location
|
---|
150 | $(PATH_INST_BIN)/ndpsmb.dll:
|
---|
151 | $(CP) $(PATH_INST_LIB)/ndpsmb.dll $(PATH_INST_BIN)
|
---|
152 |
|
---|
153 | # final: zip all files!
|
---|
154 | $(PATH_OUT)/dist/$(PACKAGE_NAME).zip: \
|
---|
155 | $(PATH_INST_BIN)/instpl.cmd \
|
---|
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 -Sr9 $@ \*
|
---|
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)/uninstpl.cmd \
|
---|
175 | $(PATH_INST_BIN)/ndpsmb.dll \
|
---|
176 | $(PATH_INST_BIN)/COPYING \
|
---|
177 | $(PATH_INST_BIN)/en/ndpsmb.hlp \
|
---|
178 | $(PATH_INST_BIN)/fr/ndpsmb.hlp \
|
---|
179 | $(PATH_INST_BIN)/de/ndpsmb.hlp \
|
---|
180 | $(PATH_INST_BIN)/readme.txt \
|
---|
181 | $(PATH_INST_BIN)/readme_fr.txt \
|
---|
182 | $(PATH_INST_BIN)/readme_de.txt
|
---|
183 | $(QUIET)$(MKDIR) -p $(PATH_OUT)/dist
|
---|
184 | $(QUIET)$(RM) -f $@
|
---|
185 | @ppwizard.cmd resources/ndpsmb.tpl /Pack:N /output:$(PATH_OBJ)/ndpsmb.wis /other /WarningsRc:0
|
---|
186 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 2 -r ".\en\*.hlp"
|
---|
187 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 3 -r ".\fr\*.hlp"
|
---|
188 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -a 4 -r ".\de\*.hlp"
|
---|
189 | $(QUIET)$(REDIRECT) -C $(PATH_INST_BIN) -- runwic.cmd $(subst /,\\,$@) -s $(subst /,\\,$(PATH_OBJ))\\ndpsmb.wis -a 1 "*"
|
---|