| 1 |
# -*- Mode: 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 |
include $(topsrcdir)/config/rules.mk |
| 8 |
|
| 9 |
ifdef NM |
| 10 |
# check_vanilla_allocations.py is tailored to Linux, so only run it there. |
| 11 |
# That should be enough to catch any problems. |
| 12 |
check-vanilla-allocations: |
| 13 |
$(PYTHON3) $(topsrcdir)/config/check_vanilla_allocations.py $(REAL_LIBRARY) |
| 14 |
|
| 15 |
# The "aggressive" variant will likely fail on some compiler/platform |
| 16 |
# combinations, but is worth running by hand every once in a while. |
| 17 |
check-vanilla-allocations-aggressive: |
| 18 |
$(PYTHON3) $(topsrcdir)/config/check_vanilla_allocations.py --aggressive $(REAL_LIBRARY) |
| 19 |
|
| 20 |
check:: check-vanilla-allocations |
| 21 |
endif |
| 22 |
|
| 23 |
$(LIBRARY_NAME).pc: js.pc |
| 24 |
cp $^ $@ |
| 25 |
|
| 26 |
# Install versioned file, for parallel installability in Linux distributions |
| 27 |
install:: $(LIBRARY_NAME).pc |
| 28 |
cp $^ $(JS_LIBRARY_NAME).pc |
| 29 |
$(SYSINSTALL) $(JS_LIBRARY_NAME).pc $(DESTDIR)$(libdir)/pkgconfig |
| 30 |
|
| 31 |
install:: ../js-config.h |
| 32 |
$(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME) |
| 33 |
|
| 34 |
# Install the profiling category list into both js/ and the root include |
| 35 |
# directory, for use with both js-specific and base profilers. |
| 36 |
install:: ../../../mozglue/baseprofiler/public/ProfilingCategoryList.h |
| 37 |
$(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME)/js |
| 38 |
$(SYSINSTALL) $^ $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME) |
| 39 |
|
| 40 |
###################################################### |
| 41 |
# BEGIN SpiderMonkey header installation |
| 42 |
# |
| 43 |
# Mozilla/Gecko/Firefox mostly doesn't concern itself with defining a sensible |
| 44 |
# install target, because it's shipping primarily packaged builds. And even if |
| 45 |
# it did, those builds wouldn't really have reason to include header files. So |
| 46 |
# we have to install public headers ourselves, rather than using something from |
| 47 |
# config/rules.mk or similar. |
| 48 |
# |
| 49 |
# The overall directory structure of the installed headers looks like so: |
| 50 |
# |
| 51 |
# $(includedir)/ |
| 52 |
# $(JS_LIBRARY_NAME)/ |
| 53 |
# jsapi.h, jspubtd.h, etc. (all of EXPORTS) |
| 54 |
# js/ |
| 55 |
# js/public/* headers (all are public) |
| 56 |
# ds/ |
| 57 |
# js/src/ds/* public headers |
| 58 |
# gc/ |
| 59 |
# js/src/gc/* public headers |
| 60 |
# mozilla/ |
| 61 |
# mfbt headers |
| 62 |
# |
| 63 |
|
| 64 |
install:: |
| 65 |
$(call py_action,process_install_manifest,$(if $(filter copy,$(NSDISTMODE)),--no-symlinks )--track install_dist_include.track --no-symlinks $(DESTDIR)$(includedir)/$(JS_LIBRARY_NAME) $(DEPTH)/_build_manifests/install/dist_include) |
| 66 |
|
| 67 |
# |
| 68 |
# END SpiderMonkey header installation |
| 69 |
############################################# |
| 70 |
|
| 71 |
# Install versioned script, for parallel installability in Linux distributions |
| 72 |
install:: js-config |
| 73 |
cp $^ js$(MOZJS_MAJOR_VERSION)-config |
| 74 |
$(SYSINSTALL) js$(MOZJS_MAJOR_VERSION)-config $(DESTDIR)$(bindir) |
| 75 |
|
| 76 |
# Use install_name_tool to set the install_name properly for standalone |
| 77 |
# installed libraries on macOS |
| 78 |
install:: $(REAL_LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) |
| 79 |
ifneq (,$(REAL_LIBRARY)) |
| 80 |
$(SYSINSTALL) $(REAL_LIBRARY) $(DESTDIR)$(libdir) |
| 81 |
mv -f $(DESTDIR)$(libdir)/$(REAL_LIBRARY) $(subst $(STATIC_LIBRARY_NAME),$(LIBRARY_NAME),$(DESTDIR)$(libdir)/$(REAL_LIBRARY)) |
| 82 |
endif |
| 83 |
ifneq (,$(SHARED_LIBRARY)) |
| 84 |
$(SYSINSTALL) $(SHARED_LIBRARY) $(DESTDIR)$(libdir) |
| 85 |
ifeq ($(OS_ARCH),Darwin) |
| 86 |
$(INSTALL_NAME_TOOL) -id $(abspath $(libdir)/$(notdir $(SHARED_LIBRARY))) $(DESTDIR)$(libdir)/$(notdir $(SHARED_LIBRARY)) |
| 87 |
endif |
| 88 |
endif |
| 89 |
ifneq (,$(IMPORT_LIBRARY)) |
| 90 |
ifneq ($(IMPORT_LIBRARY),$(SHARED_LIBRARY)) |
| 91 |
$(SYSINSTALL) $(IMPORT_LIBRARY) $(DESTDIR)$(libdir) |
| 92 |
endif |
| 93 |
endif |