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