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