michael@0: # -*- Makefile -*- michael@0: # 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: # STDCXX_COMPAT is not needed here, and will actually fail because michael@0: # libstdc++-compat is not built yet. michael@0: MOZ_LIBSTDCXX_HOST_VERSION = michael@0: michael@0: # IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have michael@0: # a recursive rule for finding nsinstall and the Perl scripts. michael@0: ifdef NSBUILDROOT michael@0: override NSBUILDROOT := michael@0: endif michael@0: michael@0: ifdef GNU_CC michael@0: MODULE_OPTIMIZE_FLAGS = -O3 michael@0: endif michael@0: michael@0: include $(topsrcdir)/config/config.mk michael@0: michael@0: ifneq (WINNT,$(HOST_OS_ARCH)) michael@0: ifdef COMPILE_ENVIRONMENT michael@0: # Ensure nsinstall is atomically created michael@0: nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM) michael@0: cp $^ $@.tmp michael@0: mv $@.tmp $@ michael@0: michael@0: NSINSTALL_EXECUTABLES := nsinstall$(HOST_BIN_SUFFIX) michael@0: NSINSTALL_DEST := $(DIST)/bin michael@0: NSINSTALL_TARGET := export michael@0: INSTALL_TARGETS += NSINSTALL michael@0: endif michael@0: endif michael@0: michael@0: ifndef JS_STANDALONE michael@0: HEADERS_FILES = \ michael@0: $(DEPTH)/mozilla-config.h \ michael@0: $(NULL) michael@0: HEADERS_DEST := $(DIST)/include michael@0: HEADERS_TARGET := export michael@0: INSTALL_TARGETS += HEADERS michael@0: endif michael@0: michael@0: PYTHON_UNIT_TESTS := $(wildcard $(srcdir)/tests/unit-*.py) michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: HOST_CFLAGS += -DUNICODE -D_UNICODE michael@0: michael@0: ifndef JS_STANDALONE michael@0: # Generate a new buildid every time we "export" in config... that's only michael@0: # supposed to be once per-build! michael@0: export:: michael@0: ifdef MOZ_BUILD_DATE michael@0: printf '%s' $(MOZ_BUILD_DATE) > buildid michael@0: else michael@0: $(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid > buildid michael@0: endif michael@0: endif michael@0: michael@0: ifdef WRAP_SYSTEM_INCLUDES michael@0: export-preqs = \ michael@0: $(call mkdir_deps,system_wrappers) \ michael@0: $(NULL) michael@0: michael@0: export:: $(export-preqs) michael@0: $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \ michael@0: -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \ michael@0: -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \ michael@0: -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \ michael@0: -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \ michael@0: -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \ michael@0: -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \ michael@0: -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \ michael@0: -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ michael@0: -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ michael@0: -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ michael@0: $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers michael@0: $(INSTALL) system_wrappers $(DIST) michael@0: michael@0: GARBAGE_DIRS += system_wrappers michael@0: endif michael@0: michael@0: ifdef WRAP_STL_INCLUDES michael@0: ifdef GNU_CXX michael@0: stl_compiler = gcc michael@0: else michael@0: ifdef _MSC_VER michael@0: stl_compiler = msvc michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: ifdef stl_compiler michael@0: STL_WRAPPERS_SENTINEL = $(DIST)/stl_wrappers/sentinel michael@0: michael@0: $(STL_WRAPPERS_SENTINEL): $(srcdir)/make-stl-wrappers.py $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers $(GLOBAL_DEPS) michael@0: $(PYTHON) $(srcdir)/make-stl-wrappers.py stl_wrappers $(stl_compiler) $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers michael@0: $(PYTHON) $(srcdir)/nsinstall.py -t stl_wrappers $(DIST) michael@0: touch $(STL_WRAPPERS_SENTINEL) michael@0: michael@0: export:: $(STL_WRAPPERS_SENTINEL) michael@0: michael@0: GARBAGE += $(STL_WRAPPERS_SENTINEL) michael@0: GARBAGE_DIRS += stl_wrappers michael@0: endif michael@0: michael@0: GARBAGE += \ michael@0: $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) buildid $(srcdir)/*.pyc *.pyc michael@0: michael@0: FORCE: michael@0: michael@0: ifndef JS_STANDALONE michael@0: check-preqs += check-jar-mn michael@0: endif michael@0: check-preqs += check-makefiles michael@0: michael@0: check:: $(check-preqs) michael@0: michael@0: check-jar-mn:: michael@0: $(MAKE) -C tests/src-simple check-jar michael@0: $(MAKE) -C tests/src-simple check-flat michael@0: $(MAKE) -C tests/src-simple check-flat USE_EXTENSION_MANIFEST=1 michael@0: ifneq (,$(filter-out WINNT,$(OS_ARCH))) michael@0: $(MAKE) -C tests/src-simple check-symlink michael@0: endif michael@0: michael@0: check-makefiles: michael@0: $(MAKE) -C tests/makefiles/autodeps check