michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: STANDALONE_MAKEFILE := 1 michael@0: michael@0: NO_PKG_FILES = \ michael@0: xulrunner-config \ michael@0: regchrome* \ michael@0: regxpcom* \ michael@0: $(NULL) michael@0: michael@0: # We want xpcshell, run-mozilla and install_app.py in the SDK but not in the binary package. michael@0: ifndef STAGE_SDK michael@0: NO_PKG_FILES += \ michael@0: xpcshell* \ michael@0: run-mozilla* \ michael@0: install_app.py \ michael@0: $(NULL) michael@0: endif michael@0: michael@0: # If we're on mac, we don't want an end-user-facing DMG, we want a .tar.bz2 michael@0: # which developers then use to package their application. michael@0: michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: MOZ_PKG_FORMAT = BZ2 michael@0: _APPNAME = XUL.framework michael@0: _BINPATH = /$(_APPNAME)/Versions/Current michael@0: endif michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: INSTALL_SDK = 1 michael@0: michael@0: include $(topsrcdir)/toolkit/mozapps/installer/signing.mk michael@0: include $(topsrcdir)/toolkit/mozapps/installer/packager.mk michael@0: michael@0: # Add pkg-config files to the install:: target michael@0: michael@0: pkg_config_files = \ michael@0: libxul.pc \ michael@0: libxul-embedding.pc \ michael@0: mozilla-js.pc \ michael@0: mozilla-plugin.pc \ michael@0: $(NULL) michael@0: michael@0: ifdef MOZ_NATIVE_NSPR michael@0: NSPR_NAME=nspr michael@0: NSPR_VERSION=$(shell $(NSPR_CONFIG) --version) michael@0: else michael@0: pkg_config_files += mozilla-nspr.pc michael@0: NSPR_NAME=mozilla-nspr michael@0: FULL_NSPR_CFLAGS=-I\$${includedir} michael@0: FULL_NSPR_LIBS=$(subst $(prefix),\$${sdkdir},$(shell $(DEPTH)/nsprpub/config/nspr-config --libs)) michael@0: NSPR_VERSION=$(shell $(DEPTH)/nsprpub/config/nspr-config --version) michael@0: endif michael@0: michael@0: MOZ_XUL_LINK = -lxpcomglue_s -lxul -lmozalloc michael@0: ifdef JS_SHARED_LIBRARY michael@0: MOZ_JS_LINK = -lmozjs michael@0: else michael@0: MOZ_JS_LINK = $(MOZ_XUL_LINK) michael@0: endif michael@0: michael@0: $(warning FULL_NSPR_CFLAGS=$(FULL_NSPR_CFLAGS)) michael@0: michael@0: ifndef MOZ_NATIVE_NSS michael@0: pkg_config_files += mozilla-nss.pc michael@0: endif michael@0: michael@0: %.pc: $(srcdir)/%.pc.in $(GLOBAL_DEPS) michael@0: cat $< | sed \ michael@0: -e "s|%prefix%|$(prefix)|" \ michael@0: -e "s|%includedir%|$(includedir)|" \ michael@0: -e "s|%idldir%|$(idldir)|" \ michael@0: -e "s|%sdkdir%|$(sdkdir)|" \ michael@0: -e "s|%MOZ_APP_NAME%|$(MOZ_APP_NAME)|" \ michael@0: -e "s|%MOZILLA_VERSION%|$(MOZ_APP_VERSION)|" \ michael@0: -e "s|%WCHAR_CFLAGS%|$(WCHAR_CFLAGS)|" \ michael@0: -e "s|%FULL_NSPR_LIBS%|$(FULL_NSPR_LIBS)|" \ michael@0: -e "s|%FULL_NSPR_CFLAGS%|$(FULL_NSPR_CFLAGS)|" \ michael@0: -e "s|%NSPR_NAME%|$(NSPR_NAME)|" \ michael@0: -e "s|%NSPR_VERSION%|$(NSPR_VERSION)|" \ michael@0: -e "s|%MOZ_XUL_LINK%|$(MOZ_XUL_LINK)|" \ michael@0: -e "s|%MOZ_JS_LINK%|$(MOZ_JS_LINK)|" > $@ michael@0: chmod 644 $@ michael@0: michael@0: install:: $(pkg_config_files) michael@0: @echo pkg_config_file: $(pkg_config_files) michael@0: $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(libdir)/pkgconfig michael@0: michael@0: GARBAGE += $(pkg_config_files) michael@0: michael@0: GARBAGE += debian/changelog michael@0: michael@0: DEBDESTDIR=debian/$(MOZ_BUILD_APP) michael@0: michael@0: GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID) michael@0: MOZ_DEB_TIMESTAMP = "$(shell date +"%a, %d %b %Y %T %z" )" michael@0: michael@0: DEFINES += \ michael@0: -DGRE_MILESTONE=$(GRE_MILESTONE) \ michael@0: -DGRE_BUILDID=$(GRE_BUILDID) \ michael@0: -DMOZ_DEB_TIMESTAMP=$(MOZ_DEB_TIMESTAMP) \ michael@0: -DMOZ_APP_NAME=$(MOZ_APP_NAME) \ michael@0: -Dinstalldir=$(installdir) \ michael@0: $(NULL) michael@0: michael@0: ifeq ($(OS_TARGET),Linux) michael@0: debian/changelog: $(srcdir)/debian/changelog.in $(LIBXUL_DIST)/bin/platform.ini michael@0: $(call py_action,preprocessor, \ michael@0: $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) michael@0: michael@0: debian/xulrunner.links: $(srcdir)/debian/xulrunner.links.in michael@0: $(call py_action,preprocessor, \ michael@0: $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) michael@0: michael@0: debian/xulrunner.service: $(srcdir)/debian/xulrunner.service.in michael@0: $(call py_action,preprocessor, \ michael@0: $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) michael@0: michael@0: debian/prerm: $(srcdir)/debian/prerm.in michael@0: $(call py_action,preprocessor, \ michael@0: $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) michael@0: michael@0: debian/postinst: $(srcdir)/debian/postinst.in michael@0: $(call py_action,preprocessor, \ michael@0: $(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $^ -o $@) michael@0: michael@0: package: michael@0: $(MAKE) package -C $(DEPTH) michael@0: michael@0: deb: package debian/changelog debian/xulrunner.service debian/xulrunner.links michael@0: $(NSINSTALL) $(topsrcdir)/$(MOZ_BUILD_APP)/installer/debian . michael@0: rm -fr $(DEBDESTDIR) michael@0: $(NSINSTALL) -D $(DEBDESTDIR)/$(installdir) michael@0: cp -pRL $(DEPTH)/dist/$(MOZ_BUILD_APP)/* $(DEBDESTDIR)/$(installdir) michael@0: $(NSINSTALL) -D $(DEBDESTDIR)/usr/share/dbus-1/services/ michael@0: cp debian/$(MOZ_BUILD_APP).service $(DEBDESTDIR)/usr/share/dbus-1/services/org.mozilla.$(MOZ_BUILD_APP).service michael@0: dh_link; fakeroot dh_fixperms; fakeroot dh_installdeb; fakeroot dh_shlibdeps; fakeroot dh_gencontrol; fakeroot dh_md5sums; fakeroot dh_builddeb; michael@0: endif michael@0: michael@0: DEB_BUILD_ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH) michael@0: # package name comes from xulrunner/installer/debian/changelog.in michael@0: DEB_PKG_NAME = $(MOZ_PKG_APPNAME)_$(GRE_MILESTONE)-$(GRE_BUILDID)_$(DEB_BUILD_ARCH).deb michael@0: # relative to $(DIST) michael@0: UPLOAD_EXTRA_FILES += ../xulrunner/$(DEB_PKG_NAME)