|
1 # This Source Code Form is subject to the terms of the Mozilla Public |
|
2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
4 |
|
5 STANDALONE_MAKEFILE := 1 |
|
6 |
|
7 NO_PKG_FILES = \ |
|
8 xulrunner-config \ |
|
9 regchrome* \ |
|
10 regxpcom* \ |
|
11 $(NULL) |
|
12 |
|
13 # We want xpcshell, run-mozilla and install_app.py in the SDK but not in the binary package. |
|
14 ifndef STAGE_SDK |
|
15 NO_PKG_FILES += \ |
|
16 xpcshell* \ |
|
17 run-mozilla* \ |
|
18 install_app.py \ |
|
19 $(NULL) |
|
20 endif |
|
21 |
|
22 # If we're on mac, we don't want an end-user-facing DMG, we want a .tar.bz2 |
|
23 # which developers then use to package their application. |
|
24 |
|
25 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) |
|
26 MOZ_PKG_FORMAT = BZ2 |
|
27 _APPNAME = XUL.framework |
|
28 _BINPATH = /$(_APPNAME)/Versions/Current |
|
29 endif |
|
30 |
|
31 include $(topsrcdir)/config/rules.mk |
|
32 |
|
33 INSTALL_SDK = 1 |
|
34 |
|
35 include $(topsrcdir)/toolkit/mozapps/installer/signing.mk |
|
36 include $(topsrcdir)/toolkit/mozapps/installer/packager.mk |
|
37 |
|
38 # Add pkg-config files to the install:: target |
|
39 |
|
40 pkg_config_files = \ |
|
41 libxul.pc \ |
|
42 libxul-embedding.pc \ |
|
43 mozilla-js.pc \ |
|
44 mozilla-plugin.pc \ |
|
45 $(NULL) |
|
46 |
|
47 ifdef MOZ_NATIVE_NSPR |
|
48 NSPR_NAME=nspr |
|
49 NSPR_VERSION=$(shell $(NSPR_CONFIG) --version) |
|
50 else |
|
51 pkg_config_files += mozilla-nspr.pc |
|
52 NSPR_NAME=mozilla-nspr |
|
53 FULL_NSPR_CFLAGS=-I\$${includedir} |
|
54 FULL_NSPR_LIBS=$(subst $(prefix),\$${sdkdir},$(shell $(DEPTH)/nsprpub/config/nspr-config --libs)) |
|
55 NSPR_VERSION=$(shell $(DEPTH)/nsprpub/config/nspr-config --version) |
|
56 endif |
|
57 |
|
58 MOZ_XUL_LINK = -lxpcomglue_s -lxul -lmozalloc |
|
59 ifdef JS_SHARED_LIBRARY |
|
60 MOZ_JS_LINK = -lmozjs |
|
61 else |
|
62 MOZ_JS_LINK = $(MOZ_XUL_LINK) |
|
63 endif |
|
64 |
|
65 $(warning FULL_NSPR_CFLAGS=$(FULL_NSPR_CFLAGS)) |
|
66 |
|
67 ifndef MOZ_NATIVE_NSS |
|
68 pkg_config_files += mozilla-nss.pc |
|
69 endif |
|
70 |
|
71 %.pc: $(srcdir)/%.pc.in $(GLOBAL_DEPS) |
|
72 cat $< | sed \ |
|
73 -e "s|%prefix%|$(prefix)|" \ |
|
74 -e "s|%includedir%|$(includedir)|" \ |
|
75 -e "s|%idldir%|$(idldir)|" \ |
|
76 -e "s|%sdkdir%|$(sdkdir)|" \ |
|
77 -e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \ |
|
78 -e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \ |
|
79 -e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \ |
|
80 -e "s|%FULL_NSPR_LIBS%|$(FULL_NSPR_LIBS)|" \ |
|
81 -e "s|%FULL_NSPR_CFLAGS%|$(FULL_NSPR_CFLAGS)|" \ |
|
82 -e "s|%NSPR_NAME%|$(NSPR_NAME)|" \ |
|
83 -e "s|%NSPR_VERSION%|$(NSPR_VERSION)|" \ |
|
84 -e "s|%MOZ_XUL_LINK%|$(MOZ_XUL_LINK)|" \ |
|
85 -e "s|%MOZ_JS_LINK%|$(MOZ_JS_LINK)|" > $@ |
|
86 chmod 644 $@ |
|
87 |
|
88 install:: $(pkg_config_files) |
|
89 @echo pkg_config_file: $(pkg_config_files) |
|
90 $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig |
|
91 |
|
92 GARBAGE += $(pkg_config_files) |
|
93 |
|
94 GARBAGE += debian/changelog |
|
95 |
|
96 DEBDESTDIR=debian/$(MOZ_BUILD_APP) |
|
97 |
|
98 GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID) |
|
99 MOZ_DEB_TIMESTAMP = "$(shell date +"%a, %d %b %Y %T %z" )" |
|
100 |
|
101 DEFINES += \ |
|
102 -DGRE_MILESTONE=$(GRE_MILESTONE) \ |
|
103 -DGRE_BUILDID=$(GRE_BUILDID) \ |
|
104 -DMOZ_DEB_TIMESTAMP=$(MOZ_DEB_TIMESTAMP) \ |
|
105 -DMOZ_APP_NAME=$(MOZ_APP_NAME) \ |
|
106 -Dinstalldir=$(installdir) \ |
|
107 $(NULL) |
|
108 |
|
109 ifeq ($(OS_TARGET),Linux) |
|
110 debian/changelog: $(srcdir)/debian/changelog.in $(LIBXUL_DIST)/bin/platform.ini |
|
111 $(call py_action,preprocessor, \ |
|
112 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) |
|
113 |
|
114 debian/xulrunner.links: $(srcdir)/debian/xulrunner.links.in |
|
115 $(call py_action,preprocessor, \ |
|
116 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) |
|
117 |
|
118 debian/xulrunner.service: $(srcdir)/debian/xulrunner.service.in |
|
119 $(call py_action,preprocessor, \ |
|
120 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) |
|
121 |
|
122 debian/prerm: $(srcdir)/debian/prerm.in |
|
123 $(call py_action,preprocessor, \ |
|
124 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) |
|
125 |
|
126 debian/postinst: $(srcdir)/debian/postinst.in |
|
127 $(call py_action,preprocessor, \ |
|
128 $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) |
|
129 |
|
130 package: |
|
131 $(MAKE) package -C $(DEPTH) |
|
132 |
|
133 deb: package debian/changelog debian/xulrunner.service debian/xulrunner.links |
|
134 $(NSINSTALL) $(topsrcdir)/$(MOZ_BUILD_APP)/installer/debian . |
|
135 rm -fr $(DEBDESTDIR) |
|
136 $(NSINSTALL) -D $(DEBDESTDIR)/$(installdir) |
|
137 cp -pRL $(DEPTH)/dist/$(MOZ_BUILD_APP)/* $(DEBDESTDIR)/$(installdir) |
|
138 $(NSINSTALL) -D $(DEBDESTDIR)/usr/share/dbus-1/services/ |
|
139 cp debian/$(MOZ_BUILD_APP).service $(DEBDESTDIR)/usr/share/dbus-1/services/org.mozilla.$(MOZ_BUILD_APP).service |
|
140 dh_link; fakeroot dh_fixperms; fakeroot dh_installdeb; fakeroot dh_shlibdeps; fakeroot dh_gencontrol; fakeroot dh_md5sums; fakeroot dh_builddeb; |
|
141 endif |
|
142 |
|
143 DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) |
|
144 # package name comes from xulrunner/installer/debian/changelog.in |
|
145 DEB_PKG_NAME = $(MOZ_PKG_APPNAME)_$(GRE_MILESTONE)-$(GRE_BUILDID)_$(DEB_BUILD_ARCH).deb |
|
146 # relative to $(DIST) |
|
147 UPLOAD_EXTRA_FILES += ../xulrunner/$(DEB_PKG_NAME) |