Backed out changeset 8c25245410c5 (bug 909888) for being far from NPOTB and breaking...
[gecko.git] / config / Makefile.in
blobe2fafe28d1249d139e7f51906dd7105131c2668a
1 # -*- Makefile -*-
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/.
7 DEPTH = @DEPTH@
8 topsrcdir = @top_srcdir@
9 srcdir = @srcdir@
10 VPATH = @srcdir@
12 include $(DEPTH)/config/autoconf.mk
14 # For sanity's sake, we compile nsinstall without the wrapped system
15 # headers, so that we can use it to set up the wrapped system headers.
16 VISIBILITY_FLAGS =
18 # STDCXX_COMPAT is not needed here, and will actually fail because
19 # libstdc++-compat is not built yet.
20 MOZ_LIBSTDCXX_HOST_VERSION =
22 ifneq (WINNT,$(HOST_OS_ARCH))
23 HOST_PROGRAM = nsinstall_real$(HOST_BIN_SUFFIX)
24 endif
26 ifndef CROSS_COMPILE
27 ifdef USE_ELF_DYNSTR_GC
28 export:: elf-dynstr-gc
29 endif
30 endif
32 # IMPORTANT: Disable NSBUILDROOT for this directory only, otherwise we have
33 # a recursive rule for finding nsinstall and the Perl scripts.
34 ifdef NSBUILDROOT
35 override NSBUILDROOT :=
36 endif
38 ifdef GNU_CC
39 MODULE_OPTIMIZE_FLAGS = -O3
40 endif
42 include $(topsrcdir)/config/config.mk
44 # Do not install util programs
45 NO_INSTALL=1
47 ifneq (WINNT,$(HOST_OS_ARCH))
48 # Ensure nsinstall is atomically created
49 nsinstall$(HOST_BIN_SUFFIX): $(HOST_PROGRAM)
50 cp $^ $@.tmp
51 mv $@.tmp $@
53 NSINSTALL_FILES := nsinstall$(HOST_BIN_SUFFIX)
54 NSINSTALL_DEST := $(DIST)/bin
55 NSINSTALL_TARGET := export
56 INSTALL_TARGETS += NSINSTALL
57 endif
59 HEADERS_FILES = \
60 $(DEPTH)/mozilla-config.h \
61 $(NULL)
62 HEADERS_DEST := $(DIST)/include
63 HEADERS_TARGET := export
64 INSTALL_TARGETS += HEADERS
66 PYTHON_UNIT_TESTS := $(wildcard $(srcdir)/tests/unit-*.py)
68 include $(topsrcdir)/config/rules.mk
70 HOST_CFLAGS += -DUNICODE -D_UNICODE
72 ifeq ($(OS_CONFIG),SunOS4.1)
73 NSPR_CFLAGS += -I$(srcdir)/../nsprpub/pr/include/md
74 endif
76 # Generate a new buildid every time we "export" in config... that's only
77 # supposed to be once per-build!
78 export::
79 ifdef MOZ_BUILD_DATE
80 printf "%s" $(MOZ_BUILD_DATE) > buildid
81 else
82 $(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid > buildid
83 endif
85 ifdef WRAP_SYSTEM_INCLUDES
86 export-preqs = \
87 $(call mkdir_deps,system_wrappers) \
88 $(NULL)
90 export:: $(export-preqs)
91 $(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) \
92 -DMOZ_TREE_CAIRO=$(MOZ_TREE_CAIRO) \
93 -DMOZ_TREE_PIXMAN=$(MOZ_TREE_PIXMAN) \
94 -DMOZ_NATIVE_HUNSPELL=$(MOZ_NATIVE_HUNSPELL) \
95 -DMOZ_NATIVE_BZ2=$(MOZ_NATIVE_BZ2) \
96 -DMOZ_NATIVE_ZLIB=$(MOZ_NATIVE_ZLIB) \
97 -DMOZ_NATIVE_PNG=$(MOZ_NATIVE_PNG) \
98 -DMOZ_NATIVE_JPEG=$(MOZ_NATIVE_JPEG) \
99 -DMOZ_NATIVE_LIBEVENT=$(MOZ_NATIVE_LIBEVENT) \
100 -DMOZ_NATIVE_LIBVPX=$(MOZ_NATIVE_LIBVPX) \
101 -DMOZ_NATIVE_ICU=$(MOZ_NATIVE_ICU) \
102 $(srcdir)/system-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
103 $(INSTALL) system_wrappers $(DIST)
105 GARBAGE_DIRS += system_wrappers
106 endif
108 ifdef WRAP_STL_INCLUDES
109 ifdef GNU_CXX
110 stl_compiler = gcc
111 else
112 ifdef _MSC_VER
113 stl_compiler = msvc
114 endif
115 endif
116 endif
118 ifdef stl_compiler
119 STL_WRAPPERS_SENTINEL = $(DIST)/stl_wrappers/sentinel
121 $(STL_WRAPPERS_SENTINEL): $(srcdir)/make-stl-wrappers.py $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers $(GLOBAL_DEPS)
122 $(PYTHON) $(srcdir)/make-stl-wrappers.py stl_wrappers $(stl_compiler) $(srcdir)/$(stl_compiler)-stl-wrapper.template.h $(srcdir)/stl-headers
123 $(PYTHON) $(srcdir)/nsinstall.py stl_wrappers $(DIST)
124 touch $(STL_WRAPPERS_SENTINEL)
126 export:: $(STL_WRAPPERS_SENTINEL)
128 GARBAGE += $(STL_WRAPPERS_SENTINEL)
129 GARBAGE_DIRS += stl_wrappers
130 endif
132 install::
133 $(SYSINSTALL) $(IFLAGS1) $(DEPTH)/mozilla-config.h $(DESTDIR)$(includedir)
135 GARBAGE += \
136 $(FINAL_LINK_COMPS) $(FINAL_LINK_LIBS) $(FINAL_LINK_COMP_NAMES) buildid $(srcdir)/*.pyc *.pyc
138 ifndef CROSS_COMPILE
139 ifdef USE_ELF_DYNSTR_GC
140 elf-dynstr-gc: elf-dynstr-gc.c $(GLOBAL_DEPS) $(call mkdir_deps,$(MDDEPDIR))
141 $(CC) $(COMPILE_CFLAGS) $(GLIB_CFLAGS) -o $@ $< $(LDFLAGS) $(GLIB_LIBS)
142 endif
143 endif
145 FORCE:
147 check-preqs = \
148 check-jar-mn \
149 check-makefiles \
150 $(NULL)
152 check:: $(check-preqs)
154 check-jar-mn::
155 $(MAKE) -C tests/src-simple check-jar
156 $(MAKE) -C tests/src-simple check-flat
157 $(MAKE) -C tests/src-simple check-flat USE_EXTENSION_MANIFEST=1
158 ifneq (,$(filter-out WINNT OS2,$(OS_ARCH)))
159 $(MAKE) -C tests/src-simple check-symlink
160 endif
162 check-makefiles:
163 $(MAKE) -C tests/makefiles/autodeps check