source: pkg/main/iceweasel/trunk/toolkit/mozapps/installer/packager.mk @ 5108

Revision 5108, 17.5 KB checked in by alanbach-guest, 5 years ago (diff)

[svn-inject] Applying Debian modifications to trunk

Line 
1# ***** BEGIN LICENSE BLOCK *****
2# Version: MPL 1.1/GPL 2.0/LGPL 2.1
3#
4# The contents of this file are subject to the Mozilla Public License Version
5# 1.1 (the "License"); you may not use this file except in compliance with
6# the License. You may obtain a copy of the License at
7# http://www.mozilla.org/MPL/
8#
9# Software distributed under the License is distributed on an "AS IS" basis,
10# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11# for the specific language governing rights and limitations under the
12# License.
13#
14# The Original Code is Mozilla Communicator client code, released
15# March 31, 1998.
16#
17# The Initial Developer of the Original Code is
18# Netscape Communications Corporation.
19# Portions created by the Initial Developer are Copyright (C) 1998
20# the Initial Developer. All Rights Reserved.
21#
22# Contributor(s):
23#   Benjamin Smedberg <bsmedberg@covad.net>
24#   Arthur Wiebe <artooro@gmail.com>
25#   Mark Mentovai <mark@moxienet.com>
26#
27# Alternatively, the contents of this file may be used under the terms of
28# either of the GNU General Public License Version 2 or later (the "GPL"),
29# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30# in which case the provisions of the GPL or the LGPL are applicable instead
31# of those above. If you wish to allow use of your version of this file only
32# under the terms of either the GPL or the LGPL, and not to allow others to
33# use your version of this file under the terms of the MPL, indicate your
34# decision by deleting the provisions above and replace them with the notice
35# and other provisions required by the GPL or the LGPL. If you do not delete
36# the provisions above, a recipient may use your version of this file under
37# the terms of any one of the MPL, the GPL or the LGPL.
38#
39# ***** END LICENSE BLOCK *****
40
41include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
42
43# This is how we create the Unix binary packages we release to the public.
44# Currently the only format is tar.gz (TGZ), but it should be fairly easy
45# to add .rpm (RPM) and .deb (DEB) later.
46
47ifndef MOZ_PKG_FORMAT
48ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
49MOZ_PKG_FORMAT  = DMG
50else
51ifeq (,$(filter-out OS2 WINNT BeOS, $(OS_ARCH)))
52MOZ_PKG_FORMAT  = ZIP
53ifeq ($(OS_ARCH),OS2)
54INSTALLER_DIR   = os2
55else
56ifeq ($(OS_ARCH), WINNT)
57INSTALLER_DIR   = windows
58endif
59endif
60else
61ifeq (,$(filter-out SunOS, $(OS_ARCH)))
62MOZ_PKG_FORMAT  = BZ2
63else
64ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
65MOZ_PKG_FORMAT  = BZ2
66else
67MOZ_PKG_FORMAT  = TGZ
68endif
69endif
70INSTALLER_DIR   = unix
71endif
72endif
73endif # MOZ_PKG_FORMAT
74
75PACKAGE       = $(PKG_BASENAME)$(PKG_SUFFIX)
76
77# By default, the SDK uses the same packaging type as the main bundle,
78# but on mac it is a .tar.bz2
79SDK_SUFFIX    = $(PKG_SUFFIX)
80SDK           = $(PKG_BASENAME).sdk$(SDK_SUFFIX)
81
82MAKE_PACKAGE    = $(error What is a $(MOZ_PKG_FORMAT) package format?);
83
84CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
85  --mode="go-w" -f
86UNPACK_TAR       = tar -x
87
88ifeq ($(MOZ_PKG_FORMAT),TAR)
89PKG_SUFFIX      = .tar
90MAKE_PACKAGE    = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) > $(PACKAGE)
91UNMAKE_PACKAGE  = $(UNPACK_TAR) < $(UNPACKAGE)
92MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk > $(SDK)
93endif
94ifeq ($(MOZ_PKG_FORMAT),TGZ)
95PKG_SUFFIX      = .tar.gz
96MAKE_PACKAGE    = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | gzip -vf9 > $(PACKAGE)
97UNMAKE_PACKAGE  = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR)
98MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | gzip -vf9 > $(SDK)
99endif
100ifeq ($(MOZ_PKG_FORMAT),BZ2)
101PKG_SUFFIX      = .tar.bz2
102MAKE_PACKAGE    = $(CREATE_FINAL_TAR) - $(MOZ_PKG_APPNAME) | bzip2 -vf > $(PACKAGE)
103UNMAKE_PACKAGE  = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR)
104MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
105endif
106ifeq ($(MOZ_PKG_FORMAT),ZIP)
107PKG_SUFFIX      = .zip
108MAKE_PACKAGE    = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_APPNAME)
109UNMAKE_PACKAGE  = $(UNZIP) $(UNPACKAGE)
110MAKE_SDK = $(ZIP) -r9D $(SDK) $(MOZ_APP_NAME)-sdk
111endif
112ifeq ($(MOZ_PKG_FORMAT),DMG)
113ifndef _APPNAME
114ifdef MOZ_DEBUG
115_APPNAME        = $(MOZ_APP_DISPLAYNAME)Debug.app
116else
117_APPNAME        = $(MOZ_APP_DISPLAYNAME).app
118endif
119endif
120ifndef _BINPATH
121_BINPATH        = /$(_APPNAME)/Contents/MacOS
122endif # _BINPATH
123PKG_SUFFIX      = .dmg
124PKG_DMG_FLAGS   =
125ifneq (,$(MOZ_PKG_MAC_DSSTORE))
126PKG_DMG_FLAGS += --copy "$(MOZ_PKG_MAC_DSSTORE):/.DS_Store"
127endif
128ifneq (,$(MOZ_PKG_MAC_BACKGROUND))
129PKG_DMG_FLAGS += --mkdir /.background --copy "$(MOZ_PKG_MAC_BACKGROUND):/.background"
130endif
131ifneq (,$(MOZ_PKG_MAC_ICON))
132PKG_DMG_FLAGS += --icon "$(MOZ_PKG_MAC_ICON)"
133endif
134ifneq (,$(MOZ_PKG_MAC_RSRC))
135PKG_DMG_FLAGS += --resource "$(MOZ_PKG_MAC_RSRC)"
136endif
137ifneq (,$(MOZ_PKG_MAC_EXTRA))
138PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA)
139endif
140_ABS_TOPSRCDIR = $(shell cd $(topsrcdir) && pwd)
141ifdef UNIVERSAL_BINARY
142STAGEPATH = universal/
143endif
144ifndef PKG_DMG_SOURCE
145PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_APPNAME)
146endif
147MAKE_PACKAGE    = $(_ABS_TOPSRCDIR)/build/package/mac_osx/pkg-dmg \
148  --source "$(PKG_DMG_SOURCE)" --target "$(PACKAGE)" \
149  --volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS)
150UNMAKE_PACKAGE  = \
151  set -ex; \
152  function cleanup() { \
153    hdiutil detach $${DEV_NAME} || \
154     { sleep 5 && hdiutil detach $${DEV_NAME} -force; }; \
155    return $$1 && $$?; \
156  }; \
157  unset NEXT_ROOT; \
158  export PAGER=true; \
159  echo Y | hdiutil attach -readonly -mountroot /tmp -private -noautoopen $(UNPACKAGE) > hdi.output; \
160  DEV_NAME=`perl -n -e 'if($$_=~/(\/dev\/disk[^ ]*)/) {print $$1."\n";exit;}'< hdi.output`; \
161  MOUNTPOINT=`perl -n -e 'split(/\/dev\/disk[^ ]*/,$$_,2);if($$_[1]=~/(\/.*)/) {print $$1."\n";exit;}'< hdi.output` || cleanup 1; \
162  rsync -a "$${MOUNTPOINT}/$(_APPNAME)" $(MOZ_PKG_APPNAME) || cleanup 1; \
163  test -n "$(MOZ_PKG_MAC_DSSTORE)" && \
164    { rsync -a "$${MOUNTPOINT}/.DS_Store" "$(MOZ_PKG_MAC_DSSTORE)" || cleanup 1; }; \
165  test -n "$(MOZ_PKG_MAC_BACKGROUND)" && \
166    { rsync -a "$${MOUNTPOINT}/.background/`basename "$(MOZ_PKG_MAC_BACKGROUND)"`" "$(MOZ_PKG_MAC_BACKGROUND)" || cleanup 1; }; \
167  test -n "$(MOZ_PKG_MAC_ICON)" && \
168    { rsync -a "$${MOUNTPOINT}/.VolumeIcon.icns" "$(MOZ_PKG_MAC_ICON)" || cleanup 1; }; \
169  cleanup 0; \
170  if test -n "$(MOZ_PKG_MAC_RSRC)" ; then \
171    cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \
172    hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \
173    { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > "$(MOZ_PKG_MAC_RSRC)" || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \
174    rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \
175  fi; \
176  $(NULL)
177# The plst and blkx resources are skipped because they belong to each
178# individual dmg and are created by hdiutil.
179SDK_SUFFIX = .tar.bz2
180SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX)
181MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
182endif
183
184# dummy macro if we don't have PSM built
185SIGN_NSS                =
186ifneq (1_,$(if $(CROSS_COMPILE),1,0)_$(UNIVERSAL_BINARY))
187ifdef MOZ_PSM
188SIGN_NSS                = @echo signing nss libraries;
189
190NSS_DLL_SUFFIX  = $(DLL_SUFFIX)
191ifdef UNIVERSAL_BINARY
192NATIVE_ARCH     = $(shell uname -p | sed -e s/powerpc/ppc/)
193NATIVE_DIST     = $(DIST)/../../$(NATIVE_ARCH)/dist
194SIGN_CMD        = $(NATIVE_DIST)/bin/run-mozilla.sh $(NATIVE_DIST)/bin/shlibsign -v -i
195else
196ifeq ($(OS_ARCH),OS2)
197# uppercase extension to get the correct output file from shlibsign
198NSS_DLL_SUFFIX  = .DLL
199SIGN_CMD        = $(topsrcdir)/toolkit/mozapps/installer/os2/sign.cmd $(DIST)
200else
201SIGN_CMD        = $(RUN_TEST_PROGRAM) $(DIST)/bin/shlibsign -v -i
202endif
203endif
204
205SOFTOKN         = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)softokn3$(NSS_DLL_SUFFIX)
206FREEBL          = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl3$(NSS_DLL_SUFFIX)
207FREEBL_32FPU    = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32fpu_3$(DLL_SUFFIX)
208FREEBL_32INT    = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32int_3$(DLL_SUFFIX)
209FREEBL_32INT64  = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_32int64_3$(DLL_SUFFIX)
210FREEBL_64FPU    = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_64fpu_3$(DLL_SUFFIX)
211FREEBL_64INT    = $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)/$(DLL_PREFIX)freebl_64int_3$(DLL_SUFFIX)
212
213SIGN_NSS        += $(SIGN_CMD) $(SOFTOKN); \
214        if test -f $(FREEBL); then $(SIGN_CMD) $(FREEBL); fi; \
215        if test -f $(FREEBL_32FPU); then $(SIGN_CMD) $(FREEBL_32FPU); fi; \
216        if test -f $(FREEBL_32INT); then $(SIGN_CMD) $(FREEBL_32INT); fi; \
217        if test -f $(FREEBL_32INT64); then $(SIGN_CMD) $(FREEBL_32INT64); fi; \
218        if test -f $(FREEBL_64FPU); then $(SIGN_CMD) $(FREEBL_64FPU); fi; \
219        if test -f $(FREEBL_64INT); then $(SIGN_CMD) $(FREEBL_64INT); fi;
220
221endif # MOZ_PSM
222endif # !CROSS_COMPILE
223
224NO_PKG_FILES += \
225        core \
226        bsdecho \
227        gtscc \
228        jscpucfg \
229        nsinstall \
230        viewer \
231        TestGtkEmbed \
232        bloaturls.txt \
233        codesighs* \
234        elf-dynstr-gc \
235        mangle* \
236        maptsv* \
237        mfc* \
238        mkdepend* \
239        msdump* \
240        msmap* \
241        nm2tsv* \
242        nsinstall* \
243        rebasedlls* \
244        res/samples \
245        res/throbber \
246        shlibsign* \
247        ssltunnel* \
248        winEmbed.exe \
249        os2Embed.exe \
250        chrome/chrome.rdf \
251        chrome/app-chrome.manifest \
252        chrome/overlayinfo \
253        components/compreg.dat \
254        components/xpti.dat \
255        content_unit_tests \
256        necko_unit_tests \
257        $(NULL)
258
259# browser/locales/Makefile uses this makefile for it's variable defs, but
260# doesn't want the libs:: rule.
261ifndef PACKAGER_NO_LIBS
262libs:: make-package
263endif
264
265DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX)
266
267ifdef MOZ_PKG_REMOVALS
268MOZ_PKG_REMOVALS_GEN = removed-files
269
270$(MOZ_PKG_REMOVALS_GEN): $(MOZ_PKG_REMOVALS) Makefile Makefile.in
271        $(PYTHON) $(topsrcdir)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) $(MOZ_PKG_REMOVALS) > $(MOZ_PKG_REMOVALS_GEN)
272
273GARBAGE += $(MOZ_PKG_REMOVALS_GEN)
274endif
275
276GARBAGE         += $(DIST)/$(PACKAGE) $(PACKAGE)
277
278ifeq ($(OS_ARCH),IRIX)
279STRIP_FLAGS     = -f
280endif
281ifeq ($(OS_ARCH),BeOS)
282STRIP_FLAGS     = -g
283PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "$(MOZ_PKG_APPNAME)-bin"
284endif
285ifeq ($(OS_ARCH),OS2)
286STRIP           = $(topsrcdir)/toolkit/mozapps/installer/os2/strip.cmd
287STRIP_FLAGS     =
288PLATFORM_EXCLUDE_LIST = ! -name "*.ico"
289endif
290
291ifneq (,$(filter WINNT OS2,$(OS_ARCH)))
292PKGCP_OS = dos
293else
294PKGCP_OS = unix
295endif
296
297# The following target stages files into three directories: one directory for
298# locale-independent files, one for locale-specific files, and one for optional
299# extensions based on the information in the MOZ_PKG_MANIFEST file and the
300# following vars:
301# MOZ_NONLOCALIZED_PKG_LIST
302# MOZ_LOCALIZED_PKG_LIST
303# MOZ_OPTIONAL_PKG_LIST
304
305PKG_ARG = , "$(pkg)"
306
307# Define packager macro to work around make 3.81 backslash issue (bug #339933)
308define PACKAGER_COPY
309$(PERL) -I$(topsrcdir)/xpinstall/packager -e 'use Packager; \
310       Packager::Copy($1,$2,$3,$4,$5,$6,$7);'
311endef
312
313installer-stage: $(MOZ_PKG_MANIFEST)
314ifndef MOZ_PKG_MANIFEST
315        $(error MOZ_PKG_MANIFEST unspecified!)
316endif
317        @rm -rf $(DEPTH)/installer-stage $(DIST)/xpt
318        @echo "Staging installer files..."
319        @$(NSINSTALL) -D $(DEPTH)/installer-stage/nonlocalized
320        @$(NSINSTALL) -D $(DEPTH)/installer-stage/localized
321        @$(NSINSTALL) -D $(DEPTH)/installer-stage/optional
322        @$(NSINSTALL) -D $(DIST)/xpt
323        $(call PACKAGER_COPY, "$(DIST)",\
324                "$(DEPTH)/installer-stage/nonlocalized", \
325                "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
326                $(foreach pkg,$(MOZ_NONLOCALIZED_PKG_LIST),$(PKG_ARG)) )
327        $(call PACKAGER_COPY, "$(DIST)",\
328                "$(DEPTH)/installer-stage/localized", \
329                "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
330                $(foreach pkg,$(MOZ_LOCALIZED_PKG_LIST),$(PKG_ARG)) )
331ifdef MOZ_OPTIONAL_PKG_LIST
332        $(call PACKAGER_COPY, "$(DIST)",\
333                "$(DEPTH)/installer-stage/optional", \
334                "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
335                $(foreach pkg,$(MOZ_OPTIONAL_PKG_LIST),$(PKG_ARG)) )
336endif
337        $(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DEPTH)/installer-stage/nonlocalized/components -v -x "$(XPIDL_LINK)"
338
339stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_REMOVALS_GEN)
340        @rm -rf $(DIST)/$(MOZ_PKG_APPNAME) $(DIST)/$(PKG_BASENAME).tar $(DIST)/$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST)
341# NOTE: this must be a tar now that dist links into the tree so that we
342# do not strip the binaries actually in the tree.
343        @echo "Creating package directory..."
344        @mkdir $(DIST)/$(MOZ_PKG_APPNAME)
345ifdef MOZ_PKG_MANIFEST
346        $(RM) -rf $(DIST)/xpt
347        $(call PACKAGER_COPY, "$(DIST)",\
348                 "$(DIST)/$(MOZ_PKG_APPNAME)", \
349                "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
350        $(PERL) $(topsrcdir)/xpinstall/packager/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_APPNAME)/components -v -x "$(XPIDL_LINK)"
351else # !MOZ_PKG_MANIFEST
352ifeq ($(MOZ_PKG_FORMAT),DMG)
353# If UNIVERSAL_BINARY, the package will be made from an already-prepared
354# STAGEPATH
355ifndef UNIVERSAL_BINARY
356ifndef STAGE_SDK
357        @cd $(DIST) && rsync -auv --copy-unsafe-links $(_APPNAME) $(MOZ_PKG_APPNAME)
358else
359        @cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -)
360endif
361endif
362else
363        @cd $(DIST)/bin && tar $(TAR_CREATE_FLAGS) - * | (cd ../$(MOZ_PKG_APPNAME); tar -xf -)
364endif # DMG
365endif # MOZ_PKG_MANIFEST
366ifndef PKG_SKIP_STRIP
367        @echo "Stripping package directory..."
368        @cd $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME); find . ! -type d \
369                        ! -name "*.js" \
370                        ! -name "*.xpt" \
371                        ! -name "*.gif" \
372                        ! -name "*.jpg" \
373                        ! -name "*.png" \
374                        ! -name "*.xpm" \
375                        ! -name "*.txt" \
376                        ! -name "*.rdf" \
377                        ! -name "*.sh" \
378                        ! -name "*.properties" \
379                        ! -name "*.dtd" \
380                        ! -name "*.html" \
381                        ! -name "*.xul" \
382                        ! -name "*.css" \
383                        ! -name "*.xml" \
384                        ! -name "*.jar" \
385                        ! -name "*.dat" \
386                        ! -name "*.tbl" \
387                        ! -name "*.src" \
388                        ! -name "*.reg" \
389                        $(PLATFORM_EXCLUDE_LIST) \
390                        -exec $(STRIP) $(STRIP_FLAGS) {} >/dev/null 2>&1 \;
391        $(SIGN_NSS)
392endif
393        @echo "Removing unpackaged files..."
394ifdef NO_PKG_FILES
395        cd $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH); rm -rf $(NO_PKG_FILES)
396endif
397ifdef MOZ_PKG_REMOVALS
398        $(SYSINSTALL) $(MOZ_PKG_REMOVALS_GEN) $(DIST)/$(STAGEPATH)$(MOZ_PKG_APPNAME)$(_BINPATH)
399endif # MOZ_PKG_REMOVALS
400
401make-package: stage-package
402        @echo "Compressing..."
403        cd $(DIST) && $(MAKE_PACKAGE)
404
405# The install target will install the application to prefix/lib/appname-version
406# In addition if INSTALL_SDK is set, it will install the development headers,
407# libraries, and IDL files as follows:
408# dist/sdk/include -> prefix/include/appname-version/stable
409# dist/include -> prefix/include/appname-version/unstable
410# dist/sdk/idl -> prefix/share/idl/appname-version/stable
411# dist/idl -> prefix/share/idl/appname-version/unstable
412# dist/sdk/lib -> prefix/lib/appname-devel-version/lib
413# prefix/lib/appname-devel-version/* symlinks to the above directories
414install:: stage-package
415ifneq (,$(filter WINNT Darwin,$(OS_ARCH)))
416        $(error "make install" is not supported on this platform. Use "make package" instead.)
417endif
418        $(NSINSTALL) -D $(DESTDIR)$(installdir)
419        (cd $(DIST)/$(MOZ_PKG_APPNAME) && tar $(TAR_CREATE_FLAGS) - .) | \
420          (cd $(DESTDIR)$(installdir) && tar -xf -)
421        $(NSINSTALL) -D $(DESTDIR)$(bindir)
422        $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME)
423        ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir)
424ifdef INSTALL_SDK # Here comes the hard part
425# include directory is stable (dist/sdk/include) and unstable (dist/include)
426        $(NSINSTALL) -D $(DESTDIR)$(includedir)/stable
427        $(NSINSTALL) -D $(DESTDIR)$(includedir)/unstable
428        (cd $(DIST)/sdk/include && tar $(TAR_CREATE_FLAGS) - .) | \
429          (cd $(DESTDIR)$(includedir)/stable && tar -xf -)
430# The dist/include has module subdirectories that we need to flatten
431        find $(DIST)/include -xtype f -exec $(SYSINSTALL) $(IFLAGS1) {} $(DESTDIR)$(includedir)/unstable \;
432# IDL directory is stable (dist/sdk/idl) and unstable (dist/idl)
433        $(NSINSTALL) -D $(DESTDIR)$(idldir)/stable
434        $(NSINSTALL) -D $(DESTDIR)$(idldir)/unstable
435        (cd $(DIST)/sdk/idl && tar $(TAR_CREATE_FLAGS) - .) | \
436          (cd $(DESTDIR)$(idldir)/stable && tar -xf -)
437        (cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \
438          (cd $(DESTDIR)$(idldir)/unstable && tar -xf -)
439# SDK directory is the libs + a bunch of symlinks
440        $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/lib
441        if test -f $(DIST)/sdk/include/xpcom-config.h; then \
442          $(SYSINSTALL) $(IFLAGS1) $(DIST)/sdk/include/xpcom-config.h $(DESTDIR)$(sdkdir); \
443        fi
444        (cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/lib && tar -xf -)
445        $(RM) -f $(DESTDIR)$(sdkdir)/lib $(DESTDIR)$(sdkdir)/bin $(DESTDIR)$(sdkdir)/sdk/include $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/sdk/idl $(DESTDIR)$(sdkdir)/idl
446        ln -s $(sdkdir)/sdk/lib $(DESTDIR)$(sdkdir)/lib
447        ln -s $(installdir) $(DESTDIR)$(sdkdir)/bin
448        ln -s $(includedir)/stable $(DESTDIR)$(sdkdir)/sdk/include
449        ln -s $(includedir)/unstable $(DESTDIR)$(sdkdir)/include
450        ln -s $(idldir)/stable $(DESTDIR)$(sdkdir)/sdk/idl
451        ln -s $(idldir)/unstable $(DESTDIR)$(sdkdir)/idl
452endif # INSTALL_SDK
453
454make-sdk:
455        $(MAKE) stage-package UNIVERSAL_BINARY= STAGE_SDK=1 MOZ_PKG_APPNAME=sdk-stage
456        @echo "Packaging SDK..."
457        $(RM) -rf $(DIST)/$(MOZ_APP_NAME)-sdk
458        $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/bin
459        (cd $(DIST)/sdk-stage && tar $(TAR_CREATE_FLAGS) - .) | \
460          (cd $(DIST)/$(MOZ_APP_NAME)-sdk/bin && tar -xf -)
461        $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin
462        (cd $(DIST)/host/bin && tar $(TAR_CREATE_FLAGS) - .) | \
463          (cd $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin && tar -xf -)
464        $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/sdk
465        (cd $(DIST)/sdk && tar $(TAR_CREATE_FLAGS) - .) | \
466          (cd $(DIST)/$(MOZ_APP_NAME)-sdk/sdk && tar -xf -)
467        $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/include
468        (cd $(DIST)/include && tar $(TAR_CREATE_FLAGS) - .) | \
469          (cd $(DIST)/$(MOZ_APP_NAME)-sdk/include && tar -xf -)
470        $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/idl
471        (cd $(DIST)/idl && tar $(TAR_CREATE_FLAGS) - .) | \
472          (cd $(DIST)/$(MOZ_APP_NAME)-sdk/idl && tar -xf -)
473        $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/lib
474# sdk/lib is the same as sdk/sdk/lib
475        (cd $(DIST)/sdk/lib && tar $(TAR_CREATE_FLAGS) - .) | \
476          (cd $(DIST)/$(MOZ_APP_NAME)-sdk/lib && tar -xf -)
477        cd $(DIST) && $(MAKE_SDK)
Note: See TracBrowser for help on using the repository browser.