xref: /aoo4110/main/solenv/inc/tg_ext.mk (revision b1cdbd2c)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24.EXPORT : CC CXX
25
26# setup INCLUDE variable for use by VC++
27.IF "$(GUI)$(COM)"=="WNTMSC"
28.IF "$(EXT_USE_STLPORT)"==""
29INCLUDE!:=. $(subst,/stl, $(SOLARINC))
30.ELSE			# "$(EXT_USE_STLPORT)"==""
31INCLUDE!:=. $(SOLARINC)
32.ENDIF			# "$(EXT_USE_STLPORT)"==""
33INCLUDE!:=$(INCLUDE:s/ -I/;/)
34.EXPORT : INCLUDE
35.ENDIF			# "$(GUI)$(COM)"=="WNTMSC"
36
37.IF "$(OS)"=="MACOSX"
38LDFLAGS!:=$(EXTRA_LINKFLAGS) $(LDFLAGS)
39.EXPORT : LDFLAGS
40.ENDIF
41
42.IF "$(GUI)"=="WNT"
43PATH!:=.:$(SOLARBINDIR:^"/cygdrive/":s/://):$(PATH)
44.ELSE           # "$(GUI)"=="WNT"
45PATH!:=.$(PATH_SEPERATOR)$(SOLARBINDIR)$(PATH_SEPERATOR)$(PATH)
46.ENDIF          # "$(GUI)"=="WNT"
47.EXPORT : PATH
48
49#override
50PACKAGE_DIR=$(MISC)/build
51ABS_PACKAGE_DIR:=$(MAKEDIR)/$(MISC)/build
52
53#MUST match with PACKAGE_DIR
54BACK_PATH=../../../
55#MUST match with reference (currently MISC)
56MBACK_PATH=../../
57.IF "$(TARFILE_IS_FLAT)" != ""
58fake_root_dir=/$(TARFILE_NAME)
59#MUST match fake_root_dir in directory levels
60fake_back=../
61.ENDIF "$(TARFILE_IS_FLAT)" != ""
62
63TARFILE_LOCATION*=$(BACK_PATH)$(fake_back)download
64TARFILE_LOCATION2=$(eq,$(BACK_PATH)$(fake_back)download,$(TARFILE_LOCATION) $(PRJ)/download $(TARFILE_LOCATION))
65
66P_CONFIGURE_DIR=$(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$(CONFIGURE_DIR)
67P_BUILD_DIR=$(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$(BUILD_DIR)
68P_INSTALL_DIR=$(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$(BUILD_DIR)
69P_INSTALL_TARGET_DIR=$(MISC)/install
70
71.IF "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
72NEW_PATCH_FILE_NAME:=$(TARFILE_NAME)
73.ELSE			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
74NEW_PATCH_FILE_NAME:=$(TARFILE_NAME)-newpatch-rename_me.patch
75PATCH_FILE_DEP:=$(PRJ)/$(PATH_IN_MODULE)/{$(PATCH_FILES)}
76.ENDIF			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
77
78unzip_quiet_switch:=-qq
79.IF "$(VERBOSE)"=="TRUE"
80tar_verbose_switch=v
81unzip_quiet_switch:=
82.ENDIF			# "$(VERBOSE)"=="TRUE"
83
84.IF "$(ADDITIONAL_FILES)"!=""
85P_ADDITIONAL_FILES=$(foreach,i,$(ADDITIONAL_FILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
86T_ADDITIONAL_FILES=$(foreach,i,$(ADDITIONAL_FILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i)
87.ENDIF			# "$(ADDITIONAL_FILES)"!=""
88
89EXTRPATH*=OOO
90
91.IF "$(L10N_framework)"==""
92
93ALLTAR : \
94	$(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) \
95	$(PACKAGE_DIR)/$(BUILD_FLAG_FILE) \
96	$(PACKAGE_DIR)/$(INSTALL_FLAG_FILE) \
97	$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) \
98	$(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE) \
99	$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) \
100	$(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE)
101
102clean:
103	$(COMMAND_ECHO)cd $(P_BUILD_DIR) && $(BUILD_ACTION) $(BUILD_FLAGS) clean
104	$(COMMAND_ECHO)$(RM) $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
105
106$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.bz2
107	@-$(RM) $@
108.IF "$(GUI)"=="UNX"
109	@noop $(assign UNPACKCMD := sh -c "bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - ")
110.ELSE			# "$(GUI)"=="UNX"
111	@noop $(assign UNPACKCMD := bzip2 -cd $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.bz2 $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - )
112.ENDIF			# "$(GUI)"=="UNX"
113	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
114	@$(RENAME) $@.$(INPATH) $@
115
116$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.Z
117	@-$(RM) $@
118.IF "$(GUI)"=="UNX"
119	@noop $(assign UNPACKCMD := sh -c "uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) -x$(tar_verbose_switch)f - ")
120.ELSE			# "$(GUI)"=="UNX"
121	@noop $(assign UNPACKCMD := uncompress -c $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.Z | $(GNUTAR) -x$(tar_verbose_switch)f - )
122.ENDIF			# "$(GUI)"=="UNX"
123	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
124	@$(RENAME) $@.$(INPATH) $@
125
126$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar.gz
127	@-$(RM) $@
128	@noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar.gz) $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - )
129	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
130	@$(RENAME) $@.$(INPATH) $@
131
132$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tgz
133	@-$(RM) $@
134	@noop $(assign UNPACKCMD := gzip -d -c $(subst,\,/ $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tgz) $(TARFILE_FILTER) | $(GNUTAR) -x$(tar_verbose_switch)f - )
135	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
136	@$(RENAME) $@.$(INPATH) $@
137
138$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.tar
139	@-$(RM) $@
140	@noop $(assign UNPACKCMD := $(GNUTAR) -x$(tar_verbose_switch)f $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).tar)
141	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
142	@$(RENAME) $@.$(INPATH) $@
143
144$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.zip
145	@-$(RM) $@
146	@noop $(assign UNPACKCMD := unzip $(unzip_quiet_switch)  -o $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).zip)
147	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
148	@$(RENAME) $@.$(INPATH) $@
149
150$(MISC)/%.unpack : $(TARFILE_LOCATION2)/%.jar
151	@-$(RM) $@
152.IF "$(OS)"=="SOLARIS"
153	@noop $(assign UNPACKCMD := jar xf $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).jar)
154.ELSE			# "$(OS)"=="SOLARIS"
155	@noop $(assign UNPACKCMD := unzip $(unzip_quiet_switch)  -o $(TARFILE_LOCATION)/$(TARFILE_MD5)-$(TARFILE_NAME).jar)
156.ENDIF			# "$(OS)"=="SOLARIS"
157	@$(TYPE) $(mktmp $(UNPACKCMD)) > $@.$(INPATH)
158	@$(RENAME) $@.$(INPATH) $@
159
160#do unpack
161$(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) : $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack $(PATCH_FILE_DEP)
162	$(IFDIREXIST) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR) $(THEN) echo "moving" && $(RENAME:s/+//) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)_removeme $(FI)
163	$(COMMAND_ECHO)-rm -rf $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)_removeme
164	@-$(MKDIRHIER) $(PACKAGE_DIR)$(fake_root_dir)
165	$(COMMAND_ECHO)cd $(PACKAGE_DIR)$(fake_root_dir) && ( $(shell @$(TYPE) $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack)) && $(TOUCH) $(UNTAR_FLAG_FILE)
166	@echo make writeable...
167	@cd $(PACKAGE_DIR) && chmod -R +rw $(TARFILE_ROOTDIR) && $(TOUCH) $(UNTAR_FLAG_FILE)
168	@cd $(PACKAGE_DIR) && find $(TARFILE_ROOTDIR) -type d -exec chmod a+x {{}} \;
169
170#add new files to patch
171$(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE) : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) $(T_ADDITIONAL_FILES:+".dummy")
172.IF "$(GUI)"=="WNT"
173    @$(TOUCH) $@
174.ELSE			# "$(GUI)"=="WNT"
175    @$(TOUCH) $@
176.ENDIF			# "$(GUI)"=="WNT"
177
178#patch
179$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE)
180.IF "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
181	@echo no patch needed...
182    $(COMMAND_ECHO)$(TOUCH) $@
183.ELSE			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
184.IF "$(GUI)"=="WNT"
185	$(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | patch --binary $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
186.ELSE           # "$(GUI)"=="WNT"
187.IF "$(BSCLIENT)"=="TRUE"
188	$(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
189.ELSE           # "$(BSCLIENT)"!=""
190	$(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) --binary $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
191.ENDIF          # "$(BSCLIENT)"!=""
192.ENDIF          # "$(GUI)"=="WNT"
193.ENDIF			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
194.IF "$(T_ADDITIONAL_FILES)"!=""
195.IF "$(GUI)"=="WNT"
196# Native W32 tools generate only filedates with even seconds, cygwin also with odd seconds
197	$(DELAY) 2
198.ENDIF # "$(GUI)"=="WNT"
199    $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
200.ENDIF          # "$(T_ADDITIONAL_FILES)"!=""
201
202.IF "$(CONVERTFILES)"!=""
203$(MISC)/$(TARGET)_convert_unx_flag :  $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
204	$(COMMAND_ECHO)$(CONVERT) unix $(foreach,i,$(CONVERTFILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) && $(TOUCH) $(MISC)/$(TARGET)_convert_unx_flag
205
206$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(MISC)/$(TARGET)_convert_unx_flag
207
208$(MISC)/$(TARGET)_convert_dos_flag : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
209	$(COMMAND_ECHO)$(CONVERT) dos  $(foreach,i,$(CONVERTFILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) && $(TOUCH) $(MISC)/$(TARGET)_convert_dos_flag
210
211$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) : $(MISC)/$(TARGET)_convert_dos_flag
212
213patch : $(MISC)/$(TARGET)_convert_dos_flag
214
215.ENDIF          # "$(CONVERTFILES)"!=""
216
217.IF "$(OS)"=="OS2"
218# YD do not trigger bash for scripts!
219CONFIG_SHELL=sh.exe
220.EXPORT: CONFIG_SHELL
221.ENDIF
222
223$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
224	@@-$(RM) $@
225.IF "$(CONFIGURE_ACTION)" == "none" || "$(CONFIGURE_ACTION)"==""
226	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
227.ELSE			# "$(CONFIGURE_ACTION)"=="none" || "$(CONFIGURE_ACTION)"==""
228	$(COMMAND_ECHO)-$(MKDIR) $(P_CONFIGURE_DIR)
229.IF "$(OS)"=="OS2"
230	$(COMMAND_ECHO)cd $(P_CONFIGURE_DIR) && sh -c "$(CONFIGURE_ACTION:s!\!/!) $(CONFIGURE_FLAGS:s!\!/!)" && $(TOUCH) $(CONFIGURE_FLAG_FILE)
231.ELSE
232	$(COMMAND_ECHO)cd $(P_CONFIGURE_DIR) && $(CONFIGURE_ACTION) $(CONFIGURE_FLAGS) && $(TOUCH) $(CONFIGURE_FLAG_FILE)
233.ENDIF
234	$(COMMAND_ECHO)mv $(P_CONFIGURE_DIR)/$(CONFIGURE_FLAG_FILE) $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
235.ENDIF			# "$(CONFIGURE_ACTION)"=="none" ||	"$(CONFIGURE_ACTION)"==""
236
237
238$(PACKAGE_DIR)/$(BUILD_FLAG_FILE) : $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
239	@@-$(RM) $@
240.IF "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
241	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
242.ELSE			# "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
243	$(COMMAND_ECHO)-$(MKDIR) $(P_BUILD_DIR)
244	$(COMMAND_ECHO)cd $(P_BUILD_DIR) && $(BUILD_ACTION) $(BUILD_FLAGS) && $(TOUCH) $(ABS_PACKAGE_DIR)/$(BUILD_FLAG_FILE)
245.ENDIF			# "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
246
247$(PACKAGE_DIR)/$(INSTALL_FLAG_FILE) : $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
248	@@-$(RM) $@
249.IF "$(INSTALL_ACTION)"=="none" ||	"$(INSTALL_ACTION)"==""
250	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
251.ELSE			# "$(INSTALL_ACTION)"=="none" ||	"$(INSTALL_ACTION)"==""
252	$(COMMAND_ECHO)-$(MKDIR) $(P_INSTALL_DIR)
253	$(COMMAND_ECHO)-$(MKDIR) $(P_INSTALL_TARGET_DIR)
254	$(COMMAND_ECHO)cd $(P_INSTALL_DIR) && $(INSTALL_ACTION) $(INSTALL_FLAGS) && $(TOUCH) $(INSTALL_FLAG_FILE)
255	$(COMMAND_ECHO)mv $(P_INSTALL_DIR)/$(INSTALL_FLAG_FILE) $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
256.ENDIF			# "$(INSTALL_ACTION)"=="none" ||	"$(INSTALL_ACTION)"==""
257
258$(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE) : $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
259.IF "$(OUT2LIB)"!=""
260	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2LIB) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(LB)
261.IF "$(OS)"=="MACOSX"
262    $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl extshl \
263        $(EXTRPATH) \
264        $(shell ls $(foreach,j,$(OUT2LIB) $(LB)/$(j:f)) | \
265            (grep -v '\.a$$' || test $$? = 1))
266.ENDIF
267.ENDIF			# "$(OUT2LIB)"!=""
268.IF "$(OUT2INC)"!=""
269.IF "$(OUT2INC_SUBDIR)"!=""
270	$(COMMAND_ECHO)-$(MKDIRHIER) $(INCCOM)/$(OUT2INC_SUBDIR)
271	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)/$(OUT2INC_SUBDIR)
272.ELSE          # "$(OUT2INC_SUBDIR)"!=""
273	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)
274.ENDIF          # "$(OUT2INC_SUBDIR)"!=""
275.ENDIF			# "$(OUT2INC)"!=""
276.IF "$(OUTDIR2INC)"!=""
277	$(COMMAND_ECHO)$(COPY) $(DEREFERENCE) $(COPYRECURSE) $(foreach,i,$(OUTDIR2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)
278.ENDIF			# "$(OUTDIR2INC)"!=""
279.IF "$(OUT2BIN)"!=""
280	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2BIN) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(BIN)
281.IF "$(GUI)$(COM)$(COMEX)"=="WNTMSC12"
282    @noop $(foreach,j,$(foreach,k,$(OUT2BIN) \
283        $(shell -ls -1 $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$k | $(GREP) .dll)) \
284        $(shell @$(IFEXIST) $(j).manifest $(THEN) mt.exe \
285        -manifest $(j).manifest -outputresource:$(BIN)/$(j:f)$(EMQ);2 $(FI)))
286.ENDIF          # "$(GUI)$(COM)$(COMEX)"=="WNTMSC12"
287.ENDIF			# "$(OUT2BIN)"!=""
288.IF "$(OUT2CLASS)"!=""
289	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2CLASS) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(CLASSDIR)
290.ENDIF			# "$(OUT2BIN)"!=""
291	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE)
292
293$(MISC)/$(TARFILE_ROOTDIR).done : $(MISC)/$(TARFILE_MD5)-$(TARFILE_NAME).unpack $(PATCH_FILES)
294	@-mv $(MISC)/$(TARFILE_ROOTDIR) $(MISC)/$(TARFILE_ROOTDIR).old
295	@-rm -rf $(MISC)/$(TARFILE_ROOTDIR).old
296	@-$(MKDIRHIER) $(MISC)$(fake_root_dir)
297	$(COMMAND_ECHO)cd $(MISC)$(fake_root_dir) && $(subst,$(BACK_PATH),$(MBACK_PATH) $(shell @$(TYPE) $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack))
298.IF "$(P_ADDITIONAL_FILES)"!=""
299	noop $(foreach,i,$(P_ADDITIONAL_FILES) $(shell echo dummy > $i))
300.ENDIF			 "$(P_ADDITIONAL_FILES)"!=""
301.IF "$(PATCH_FILES)"!="none" &&	"$(PATCH_FILES)"!=""
302.IF "$(CONVERTFILES)"!=""
303	$(CONVERT) unix $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
304.ENDIF          # "$(CONVERTFILES)"!=""
305.IF "$(GUI)"=="WNT"
306	$(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | patch --binary $(PATCHFLAGS) -p2
307.ELSE           # "$(GUI)"=="WNT"
308.IF "$(BSCLIENT)"=="TRUE"
309	$(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2
310.ELSE           # "$(BSCLIENT)"!=""
311	$(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) --binary $(PATCHFLAGS) -p2
312.ENDIF          # "$(BSCLIENT)"!=""
313.ENDIF          # "$(GUI)"=="WNT"
314.IF "$(CONVERTFILES)"!=""
315	$(COMMAND_ECHO)$(CONVERT) dos  $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
316.ENDIF          # "$(CONVERTFILES)"!=""
317.ENDIF			# "$(PATCH_FILES)"!="none" && "$(PATCH_FILES)"!="
318.IF "$(GUI)"=="UNX"
319	$(COMMAND_ECHO)$(TOUCH) $@
320.ENDIF			# "$(GUI)"=="UNX"
321
322.IF "$(T_ADDITIONAL_FILES)"!=""
323$(T_ADDITIONAL_FILES:+".dummy") : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
324	@-$(MKDIRHIER) $(@:d)
325	$(COMMAND_ECHO)-echo dummy > $@
326	$(COMMAND_ECHO)-$(TOUCH) $@
327	$(COMMAND_ECHO)-echo dummy > $(@:d)$(@:b)
328	$(COMMAND_ECHO)-$(TOUCH) $(@:d)$(@:b)
329.ENDIF			 "$(T_ADDITIONAL_FILES)"!=""
330
331create_patch : $(MISC)/$(TARFILE_ROOTDIR).done $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
332	@@-$(MKDIRHIER) $(PRJ)/$(NEW_PATCH_FILE_NAME:d)
333	@@-$(RM) $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp
334	@@-$(RM) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
335#ignore returncode of 1 (indicates differences...)
336# hard coded again to get the same directory level as before. quite ugly...
337	$(COMMAND_ECHO)-cd $(PRJ)/$(ROUT) && diff -ru misc/$(TARFILE_ROOTDIR) misc/build/$(TARFILE_ROOTDIR) | $(PERL) $(SOLARENV)/bin/cleandiff.pl | tr -d "\015" > misc/$(NEW_PATCH_FILE_NAME:f).tmp
338	$(COMMAND_ECHO)-mv $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
339	$(COMMAND_ECHO)-$(TOUCH) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
340	$(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/patch_sanitizer.pl $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME)
341	@@-$(RM) $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
342.IF "$(GUI)" == "OS2"
343	$(COMMAND_ECHO)dmake $(MAKEMACROS) patch
344.ELSE
345	$(COMMAND_ECHO)$(MAKECMD) $(MAKEMACROS) patch
346.ENDIF
347	@echo still some problems with win32 generated patches...
348	@echo $(USQ)find your new changes in $(NEW_PATCH_FILE_NAME). don't forget to move/rename that patch and insert it in your makefiles PATCH_FILES to activate.$(USQ)
349
350create_clean : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
351	@echo done
352
353patch : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
354	@echo done
355
356.ENDIF			# "$(L10N_framework)"==""
357