xref: /trunk/main/solenv/inc/tg_ext.mk (revision 9ec97a62)
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 +rwX $(TARFILE_ROOTDIR) && $(TOUCH) $(UNTAR_FLAG_FILE)
168
169#add new files to patch
170$(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE) : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE) $(T_ADDITIONAL_FILES:+".dummy")
171.IF "$(GUI)"=="WNT"
172    @$(TOUCH) $@
173.ELSE			# "$(GUI)"=="WNT"
174    @$(TOUCH) $@
175.ENDIF			# "$(GUI)"=="WNT"
176
177#patch
178$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(PACKAGE_DIR)/$(ADD_FILES_FLAG_FILE)
179.IF "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
180	@echo no patch needed...
181    $(COMMAND_ECHO)$(TOUCH) $@
182.ELSE			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
183.IF "$(GUI)"=="WNT"
184	$(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE:s/+//) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | patch --binary $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
185.ELSE           # "$(GUI)"=="WNT"
186.IF "$(BSCLIENT)"=="TRUE"
187	$(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
188.ELSE           # "$(BSCLIENT)"!=""
189	$(COMMAND_ECHO)cd $(PACKAGE_DIR) && $(TYPE) $(BACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) --binary $(PATCHFLAGS) -p2 && $(TOUCH) $(PATCH_FLAG_FILE)
190.ENDIF          # "$(BSCLIENT)"!=""
191.ENDIF          # "$(GUI)"=="WNT"
192.ENDIF			# "$(PATCH_FILES)"=="none" ||	"$(PATCH_FILES)"==""
193.IF "$(T_ADDITIONAL_FILES)"!=""
194.IF "$(GUI)"=="WNT"
195# Native W32 tools generate only filedates with even seconds, cygwin also with odd seconds
196	$(DELAY) 2
197.ENDIF # "$(GUI)"=="WNT"
198    $(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
199.ENDIF          # "$(T_ADDITIONAL_FILES)"!=""
200
201.IF "$(CONVERTFILES)"!=""
202$(MISC)/$(TARGET)_convert_unx_flag :  $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
203	$(COMMAND_ECHO)$(CONVERT) unix $(foreach,i,$(CONVERTFILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) && $(TOUCH) $(MISC)/$(TARGET)_convert_unx_flag
204
205$(PACKAGE_DIR)/$(PATCH_FLAG_FILE) : $(MISC)/$(TARGET)_convert_unx_flag
206
207$(MISC)/$(TARGET)_convert_dos_flag : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
208	$(COMMAND_ECHO)$(CONVERT) dos  $(foreach,i,$(CONVERTFILES) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) && $(TOUCH) $(MISC)/$(TARGET)_convert_dos_flag
209
210$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) : $(MISC)/$(TARGET)_convert_dos_flag
211
212patch : $(MISC)/$(TARGET)_convert_dos_flag
213
214.ENDIF          # "$(CONVERTFILES)"!=""
215
216.IF "$(OS)"=="OS2"
217# YD do not trigger bash for scripts!
218CONFIG_SHELL=sh.exe
219.EXPORT: CONFIG_SHELL
220.ENDIF
221
222$(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE) : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
223	@@-$(RM) $@
224.IF "$(CONFIGURE_ACTION)" == "none" || "$(CONFIGURE_ACTION)"==""
225	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
226.ELSE			# "$(CONFIGURE_ACTION)"=="none" || "$(CONFIGURE_ACTION)"==""
227	$(COMMAND_ECHO)-$(MKDIR) $(P_CONFIGURE_DIR)
228.IF "$(OS)"=="OS2"
229	$(COMMAND_ECHO)cd $(P_CONFIGURE_DIR) && sh -c "$(CONFIGURE_ACTION:s!\!/!) $(CONFIGURE_FLAGS:s!\!/!)" && $(TOUCH) $(CONFIGURE_FLAG_FILE)
230.ELSE
231	$(COMMAND_ECHO)cd $(P_CONFIGURE_DIR) && $(CONFIGURE_ACTION) $(CONFIGURE_FLAGS) && $(TOUCH) $(CONFIGURE_FLAG_FILE)
232.ENDIF
233	$(COMMAND_ECHO)mv $(P_CONFIGURE_DIR)/$(CONFIGURE_FLAG_FILE) $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
234.ENDIF			# "$(CONFIGURE_ACTION)"=="none" ||	"$(CONFIGURE_ACTION)"==""
235
236
237$(PACKAGE_DIR)/$(BUILD_FLAG_FILE) : $(PACKAGE_DIR)/$(CONFIGURE_FLAG_FILE)
238	@@-$(RM) $@
239.IF "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
240	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
241.ELSE			# "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
242	$(COMMAND_ECHO)-$(MKDIR) $(P_BUILD_DIR)
243	$(COMMAND_ECHO)cd $(P_BUILD_DIR) && $(BUILD_ACTION) $(BUILD_FLAGS) && $(TOUCH) $(ABS_PACKAGE_DIR)/$(BUILD_FLAG_FILE)
244.ENDIF			# "$(eq,x$(BUILD_ACTION:s/none//)x,xx true false)"=="true"
245
246$(PACKAGE_DIR)/$(INSTALL_FLAG_FILE) : $(PACKAGE_DIR)/$(BUILD_FLAG_FILE)
247	@@-$(RM) $@
248.IF "$(INSTALL_ACTION)"=="none" ||	"$(INSTALL_ACTION)"==""
249	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
250.ELSE			# "$(INSTALL_ACTION)"=="none" ||	"$(INSTALL_ACTION)"==""
251	$(COMMAND_ECHO)-$(MKDIR) $(P_INSTALL_DIR)
252	$(COMMAND_ECHO)-$(MKDIR) $(P_INSTALL_TARGET_DIR)
253	$(COMMAND_ECHO)cd $(P_INSTALL_DIR) && $(INSTALL_ACTION) $(INSTALL_FLAGS) && $(TOUCH) $(INSTALL_FLAG_FILE)
254	$(COMMAND_ECHO)mv $(P_INSTALL_DIR)/$(INSTALL_FLAG_FILE) $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
255.ENDIF			# "$(INSTALL_ACTION)"=="none" ||	"$(INSTALL_ACTION)"==""
256
257$(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE) : $(PACKAGE_DIR)/$(INSTALL_FLAG_FILE)
258.IF "$(OUT2LIB)"!=""
259	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2LIB) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(LB)
260.IF "$(OS)"=="MACOSX"
261    $(COMMAND_ECHO)$(PERL) $(SOLARENV)/bin/macosx-change-install-names.pl extshl \
262        $(EXTRPATH) \
263        $(shell ls $(foreach,j,$(OUT2LIB) $(LB)/$(j:f)) | \
264            (grep -v '\.a$$' || test $$? = 1))
265.ENDIF
266.ENDIF			# "$(OUT2LIB)"!=""
267.IF "$(OUT2INC)"!=""
268.IF "$(OUT2INC_SUBDIR)"!=""
269	$(COMMAND_ECHO)-$(MKDIRHIER) $(INCCOM)/$(OUT2INC_SUBDIR)
270	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)/$(OUT2INC_SUBDIR)
271.ELSE          # "$(OUT2INC_SUBDIR)"!=""
272	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)
273.ENDIF          # "$(OUT2INC_SUBDIR)"!=""
274.ENDIF			# "$(OUT2INC)"!=""
275.IF "$(OUTDIR2INC)"!=""
276	$(COMMAND_ECHO)$(COPY) $(DEREFERENCE) $(COPYRECURSE) $(foreach,i,$(OUTDIR2INC) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(INCCOM)
277.ENDIF			# "$(OUTDIR2INC)"!=""
278.IF "$(OUT2BIN)"!=""
279	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2BIN) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(BIN)
280.IF "$(GUI)$(COM)$(COMEX)"=="WNTMSC12"
281    @noop $(foreach,j,$(foreach,k,$(OUT2BIN) \
282        $(shell -ls -1 $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$k | $(GREP) .dll)) \
283        $(shell @$(IFEXIST) $(j).manifest $(THEN) mt.exe \
284        -manifest $(j).manifest -outputresource:$(BIN)/$(j:f)$(EMQ);2 $(FI)))
285.ENDIF          # "$(GUI)$(COM)$(COMEX)"=="WNTMSC12"
286.ENDIF			# "$(OUT2BIN)"!=""
287.IF "$(OUT2CLASS)"!=""
288	$(COMMAND_ECHO)$(COPY) $(foreach,i,$(OUT2CLASS) $(PACKAGE_DIR)/$(TARFILE_ROOTDIR)/$i) $(CLASSDIR)
289.ENDIF			# "$(OUT2BIN)"!=""
290	$(COMMAND_ECHO)$(TOUCH) $(PACKAGE_DIR)/$(PREDELIVER_FLAG_FILE)
291
292$(MISC)/$(TARFILE_ROOTDIR).done : $(MISC)/$(TARFILE_MD5)-$(TARFILE_NAME).unpack $(PATCH_FILES)
293	@-mv $(MISC)/$(TARFILE_ROOTDIR) $(MISC)/$(TARFILE_ROOTDIR).old
294	@-rm -rf $(MISC)/$(TARFILE_ROOTDIR).old
295	@-$(MKDIRHIER) $(MISC)$(fake_root_dir)
296	$(COMMAND_ECHO)cd $(MISC)$(fake_root_dir) && $(subst,$(BACK_PATH),$(MBACK_PATH) $(shell @$(TYPE) $(PRJ)/$(ROUT)/misc/$(TARFILE_MD5)-$(TARFILE_NAME).unpack))
297.IF "$(P_ADDITIONAL_FILES)"!=""
298	noop $(foreach,i,$(P_ADDITIONAL_FILES) $(shell echo dummy > $i))
299.ENDIF			 "$(P_ADDITIONAL_FILES)"!=""
300.IF "$(PATCH_FILES)"!="none" &&	"$(PATCH_FILES)"!=""
301.IF "$(CONVERTFILES)"!=""
302	$(CONVERT) unix $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
303.ENDIF          # "$(CONVERTFILES)"!=""
304.IF "$(GUI)"=="WNT"
305	$(COMMAND_ECHO)cd $(MISC) && $(TYPE:s/+//) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | patch --binary $(PATCHFLAGS) -p2
306.ELSE           # "$(GUI)"=="WNT"
307.IF "$(BSCLIENT)"=="TRUE"
308	$(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) -f $(PATCHFLAGS) -p2
309.ELSE           # "$(BSCLIENT)"!=""
310	$(COMMAND_ECHO)cd $(MISC) && $(TYPE) $(MBACK_PATH)$(PATH_IN_MODULE)/{$(PATCH_FILES)} | $(GNUPATCH) --binary $(PATCHFLAGS) -p2
311.ENDIF          # "$(BSCLIENT)"!=""
312.ENDIF          # "$(GUI)"=="WNT"
313.IF "$(CONVERTFILES)"!=""
314	$(COMMAND_ECHO)$(CONVERT) dos  $(foreach,i,$(CONVERTFILES) $(MISC)/$(TARFILE_ROOTDIR)/$i)
315.ENDIF          # "$(CONVERTFILES)"!=""
316.ENDIF			# "$(PATCH_FILES)"!="none" && "$(PATCH_FILES)"!="
317.IF "$(GUI)"=="UNX"
318	$(COMMAND_ECHO)$(TOUCH) $@
319.ENDIF			# "$(GUI)"=="UNX"
320
321.IF "$(T_ADDITIONAL_FILES)"!=""
322$(T_ADDITIONAL_FILES:+".dummy") : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
323	@-$(MKDIRHIER) $(@:d)
324	$(COMMAND_ECHO)-echo dummy > $@
325	$(COMMAND_ECHO)-$(TOUCH) $@
326	$(COMMAND_ECHO)-echo dummy > $(@:d)$(@:b)
327	$(COMMAND_ECHO)-$(TOUCH) $(@:d)$(@:b)
328.ENDIF			 "$(T_ADDITIONAL_FILES)"!=""
329
330create_patch : $(MISC)/$(TARFILE_ROOTDIR).done $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
331	@@-$(MKDIRHIER) $(PRJ)/$(NEW_PATCH_FILE_NAME:d)
332	@@-$(RM) $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp
333	@@-$(RM) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
334#ignore returncode of 1 (indicates differences...)
335# hard coded again to get the same directory level as before. quite ugly...
336	$(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
337	$(COMMAND_ECHO)-mv $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
338	$(COMMAND_ECHO)-$(TOUCH) $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
339	$(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)
340	@@-$(RM) $(MISC)/$(NEW_PATCH_FILE_NAME:f).tmp $(PRJ)/$(PATH_IN_MODULE)/$(NEW_PATCH_FILE_NAME).bak
341.IF "$(GUI)" == "OS2"
342	$(COMMAND_ECHO)dmake $(MAKEMACROS) patch
343.ELSE
344	$(COMMAND_ECHO)$(MAKECMD) $(MAKEMACROS) patch
345.ENDIF
346	@echo still some problems with win32 generated patches...
347	@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)
348
349create_clean : $(PACKAGE_DIR)/$(UNTAR_FLAG_FILE)
350	@echo done
351
352patch : $(PACKAGE_DIR)/$(PATCH_FLAG_FILE)
353	@echo done
354
355.ENDIF			# "$(L10N_framework)"==""
356