|
1 # -*- Makefile -*- |
|
2 # |
|
3 # This Source Code Form is subject to the terms of the Mozilla Public |
|
4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
|
6 |
|
7 # STDCXX_COMPAT is not needed here, and will actually fail because |
|
8 # libstdc++-compat is not built yet. |
|
9 MOZ_LIBSTDCXX_HOST_VERSION = |
|
10 |
|
11 # IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have |
|
12 # a recursive rule for finding nsinstall and the Perl scripts. |
|
13 ifdef NSBUILDROOT |
|
14 override NSBUILDROOT := |
|
15 endif |
|
16 |
|
17 ifdef GNU_CC |
|
18 MODULE_OPTIMIZE_FLAGS = -O3 |
|
19 endif |
|
20 |
|
21 include $(topsrcdir)/config/config.mk |
|
22 |
|
23 ifneq (WINNT,$(HOST_OS_ARCH)) |
|
24 ifdef COMPILE_ENVIRONMENT |
|
25 # Ensure nsinstall is atomically created |
|
26 nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM) |
|
27 cp $^ $@.tmp |
|
28 mv $@.tmp $@ |
|
29 |
|
30 NSINSTALL_EXECUTABLES := nsinstall$(HOST_BIN_SUFFIX) |
|
31 NSINSTALL_DEST := $(DIST)/bin |
|
32 NSINSTALL_TARGET := export |
|
33 INSTALL_TARGETS += NSINSTALL |
|
34 endif |
|
35 endif |
|
36 |
|
37 ifndef JS_STANDALONE |
|
38 HEADERS_FILES = \ |
|
39 $(DEPTH)/mozilla-config.h \ |
|
40 $(NULL) |
|
41 HEADERS_DEST := $(DIST)/include |
|
42 HEADERS_TARGET := export |
|
43 INSTALL_TARGETS += HEADERS |
|
44 endif |
|
45 |
|
46 PYTHON_UNIT_TESTS := $(wildcard $(srcdir)/tests/unit-*.py) |
|
47 |
|
48 include $(topsrcdir)/config/rules.mk |
|
49 |
|
50 HOST_CFLAGS += -DUNICODE -D_UNICODE |
|
51 |
|
52 ifndef JS_STANDALONE |
|
53 # Generate a new buildid every time we "export" in config... that's only |
|
54 # supposed to be once per-build! |
|
55 export:: |
|
56 ifdef MOZ_BUILD_DATE |
|
57 printf '%s' $(MOZ_BUILD_DATE) > buildid |
|
58 else |
|
59 $(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid > buildid |
|
60 endif |
|
61 endif |
|
62 |
|
63 ifdef WRAP_SYSTEM_INCLUDES |
|
64 export-preqs = \ |
|
65 $(call mkdir_deps,system_wrappers) \ |
|
66 $(NULL) |
|
67 |
|
68 export:: $(export-preqs) |
|
69 $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) \ |
|
70 -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \ |
|
71 -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \ |
|
72 -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \ |
|
73 -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \ |
|
74 -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \ |
|
75 -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \ |
|
76 -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \ |
|
77 -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \ |
|
78 -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \ |
|
79 -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \ |
|
80 $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers |
|
81 $(INSTALL) system_wrappers $(DIST) |
|
82 |
|
83 GARBAGE_DIRS += system_wrappers |
|
84 endif |
|
85 |
|
86 ifdef WRAP_STL_INCLUDES |
|
87 ifdef GNU_CXX |
|
88 stl_compiler = gcc |
|
89 else |
|
90 ifdef _MSC_VER |
|
91 stl_compiler = msvc |
|
92 endif |
|
93 endif |
|
94 endif |
|
95 |
|
96 ifdef stl_compiler |
|
97 STL_WRAPPERS_SENTINEL = $(DIST)/stl_wrappers/sentinel |
|
98 |
|
99 $(STL_WRAPPERS_SENTINEL): $(srcdir)/make-stl-wrappers.py $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers $(GLOBAL_DEPS) |
|
100 $(PYTHON) $(srcdir)/make-stl-wrappers.py stl_wrappers $(stl_compiler) $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers |
|
101 $(PYTHON) $(srcdir)/nsinstall.py -t stl_wrappers $(DIST) |
|
102 touch $(STL_WRAPPERS_SENTINEL) |
|
103 |
|
104 export:: $(STL_WRAPPERS_SENTINEL) |
|
105 |
|
106 GARBAGE += $(STL_WRAPPERS_SENTINEL) |
|
107 GARBAGE_DIRS += stl_wrappers |
|
108 endif |
|
109 |
|
110 GARBAGE += \ |
|
111 $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) buildid $(srcdir)/*.pyc *.pyc |
|
112 |
|
113 FORCE: |
|
114 |
|
115 ifndef JS_STANDALONE |
|
116 check-preqs += check-jar-mn |
|
117 endif |
|
118 check-preqs += check-makefiles |
|
119 |
|
120 check:: $(check-preqs) |
|
121 |
|
122 check-jar-mn:: |
|
123 $(MAKE) -C tests/src-simple check-jar |
|
124 $(MAKE) -C tests/src-simple check-flat |
|
125 $(MAKE) -C tests/src-simple check-flat USE_EXTENSION_MANIFEST=1 |
|
126 ifneq (,$(filter-out WINNT,$(OS_ARCH))) |
|
127 $(MAKE) -C tests/src-simple check-symlink |
|
128 endif |
|
129 |
|
130 check-makefiles: |
|
131 $(MAKE) -C tests/makefiles/autodeps check |