diff options
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 329 |
1 files changed, 273 insertions, 56 deletions
diff --git a/Makefile.in b/Makefile.in index 107bf80bb5..2dcc89144d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,19 +1,19 @@ # # %CopyrightBegin% -# -# Copyright Ericsson AB 1998-2009. All Rights Reserved. -# +# +# Copyright Ericsson AB 1998-2010. All Rights Reserved. +# # The contents of this file are subject to the Erlang Public License, # Version 1.1, (the "License"); you may not use this file except in # compliance with the License. You should have received a copy of the # Erlang Public License along with this software. If not, it can be # retrieved online at http://www.erlang.org/. -# +# # Software distributed under the License is distributed on an "AS IS" # basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See # the License for the specific language governing rights and limitations # under the License. -# +# # %CopyrightEnd% # Toplevel makefile for building the Erlang system @@ -27,6 +27,9 @@ SHELL = /bin/sh # The top directory in which Erlang is unpacked ERL_TOP = @ERL_TOP@ +# OTP release +OTP = @OTP@ + # erts (Erlang RunTime System) version ERTS = @ERTS@ @@ -41,48 +44,105 @@ ERTS = @ERTS@ # configure. # -# prefix from autoconf, default is /usr/local (must be an absolute path) -prefix = @prefix@ -exec_prefix = @exec_prefix@ +# prefix from configure, default is /usr/local (must be an absolute path) +prefix = @prefix@ +exec_prefix = @exec_prefix@ -# The following can be set in case you install Erlang in a different -# location from where you have configured it to run. This can be -# useful e.g. when installing on a server that stores the files with a -# different path from where the clients access them. Or when building -# rpms. -#INSTALL_PREFIX = -# Naah...override `prefix' instead. +# Locations where we should install according to configure. These location +# may be prefixed by $(DESTDIR) and/or $(EXTRA_PREFIX) (see below). +bindir = @bindir@ +libdir = @libdir@ -# The directory in which user executables (ERL_BASE_PUB_FILES) are put -BINDIR = $(INSTALL_PREFIX)@bindir@ +# Where Erlang/OTP is located +libdir_suffix = /erlang +erlang_libdir = $(libdir)$(libdir_suffix) +erlang_bindir = $(erlang_libdir)/bin + +# +# By default we install relative symbolic links for $(ERL_BASE_PUB_FILES) +# from $(bindir) to $(erlang_bindir) as long as they are both prefixed +# by $(exec_prefix) (and are otherwise reasonable). This behavior can be +# overridden by passing BINDIR_SYMLINKS=<HOW>, where <HOW> is either +# absolute or relative. +# + +# $ make DESTDIR=<...> install +# +# DESTDIR can be set in case you want to install Erlang in a different +# location than where you have configured it to run. This can be +# useful, e.g. when installing on a server that stores the files with a +# different path than where the clients access them, when building +# rpms, or cross compiling, etc. DESTDIR will prefix the actual +# installation which will only be able to run once the DESTDIR prefix +# has disappeard, e.g. the part after DESTDIR has been packed and +# unpacked without DESTDIR. The name DESTDIR have been chosen since it +# is the GNU coding standard way of doing it. +# +# If INSTALL_PREFIX is set but not DESTDIR, DESTDIR will be set to +# INSTALL_PREFIX. INSTALL_PREFIX has been buggy for a long time. It was +# initially intended to have the same effect as DESTDIR. This effect was, +# however, lost even before it was first released :-( In all released OTP +# versions up to R13B03, INSTALL_PREFIX has behaved as EXTRA_PREFIX do +# today (see below). + +ifeq ($(DESTDIR),) +ifneq ($(INSTALL_PREFIX),) +DESTDIR=$(INSTALL_PREFIX) +endif +else +ifneq ($(INSTALL_PREFIX),) +ifneq ($(DESTDIR),$(INSTALL_PREFIX)) +$(error Both DESTDIR="$(DESTDIR)" and INSTALL_PREFIX="$(INSTALL_PREFIX)" have been set and have been set differently! Please, only set one of them) +endif +endif +endif + +# $ make EXTRA_PREFIX=<...> install +# +# EXTRA_PREFIX behaves exactly as the buggy INSTALL_PREFIX behaved in +# pre R13B04 releases. It adds a prefix to all installation paths which +# will be used by the actuall installation. That is, the installation +# needs to be located at this location when run. This is useful if you +# want to try out the system, running test suites, etc, before doing the +# real install using the configuration you have set up using `configure'. +# A similar thing can be done by overriding `prefix' if only default +# installation directories are used. However, the installation can get +# sprawled out all over the place if the user use `--bindir', `--libdir', +# etc, and it is possible that `prefix' wont have any effect at all. That +# is, it is not at all the same thing as using EXTRA_PREFIX in the +# general case. It is also nice to be able to supply this feature if +# someone should have relied on the old buggy INSTALL_PREFIX. + +# The directory in which user executables (ERL_BASE_PUB_FILES) are installed +BINDIR = $(DESTDIR)$(EXTRA_PREFIX)$(bindir) # # Erlang base public files # ERL_BASE_PUB_FILES=erl erlc epmd run_erl to_erl dialyzer typer escript -# The directory which will contain installed Erlang version. -# (ILIBDIR is supposed to be LIBDIR *without* the install prefix) -ERLANG_LIBDIR = $(INSTALL_PREFIX)@libdir@/erlang -ERLANG_ILIBDIR = @libdir@/erlang +# ERLANG_INST_LIBDIR is the top directory where the Erlang installation +# will be located when running. +ERLANG_INST_LIBDIR=$(EXTRA_PREFIX)$(erlang_libdir) +ERLANG_INST_BINDIR= $(ERLANG_INST_LIBDIR)/bin -# You can *not* change these two, they have to stay this way for now. -ERLANG_BINDIR = $(ERLANG_LIBDIR)/bin -ERLANG_ERTSBINDIR = $(ERLANG_LIBDIR)/$(ERTS)/bin +# ERLANG_LIBDIR is the top directory where the Erlang installation is copied +# during installation. If DESTDIR != "", it cannot be run from this location. +ERLANG_LIBDIR = $(DESTDIR)$(ERLANG_INST_LIBDIR) # The directory in which man pages for above executables are put -ERL_MAN1DIR = $(INSTALL_PREFIX)@mandir@/man1 +ERL_MAN1DIR = $(DESTDIR)$(EXTRA_PREFIX)@mandir@/man1 ERL_MAN1EXT = 1 # The directory in which Erlang private man pages are put. In order # not to clutter up the man namespace these are by default put in the -# Erlang private directory $(ERLANG_ILIBDIR)/man. If you want to -# install the man pages together with the rest give the argument -# "--disable-erlang-mandir" when you run configure, which will set -# MAN_DIR to @mandir@. +# Erlang private directory $(ERLANG_LIBDIR)/man (\@erl_mandir\@ is set +# to $(erlang_libdir)/man). If you want to install the man pages +# together with the rest give the argument "--disable-erlang-mandir" +# when you run configure, which will set \@erl_mandir\@ to \@mandir\@. # If you want a special suffix on the manpages set ERL_MANEXT to # this suffix, e.g. "erl" -ERL_MANDIR = $(INSTALL_PREFIX)@erl_mandir@ +ERL_MANDIR = $(DESTDIR)$(EXTRA_PREFIX)@erl_mandir@ ERL_MANEXT = # ---------------------------------------------------------------------- @@ -93,6 +153,19 @@ MAKE = @MAKE_PROG@ # This should be set to the target "arch-vendor-os" export TARGET = @TARGET@ +BOOTSTRAP_ONLY = @BOOTSTRAP_ONLY@ + +CROSS_COMPILING = @CROSS_COMPILING@ +ifeq ($(CROSS_COMPILING),yes) +INSTALL_CROSS = -cross +else +ifneq ($(DESTDIR),) +INSTALL_CROSS = -cross +else +INSTALL_CROSS = +endif +endif + # A BSD compatible install program INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ @@ -107,6 +180,12 @@ RANLIB = @RANLIB@ # ---------------------------------------------------------------------- +# By default we require an Erlang/OTP of the same release as the one +# we cross compile. +ERL_XCOMP_FORCE_DIFFERENT_OTP = no + +# ---------------------------------------------------------------------- + # # The directory where at least the primary bootstrap is placed under. # @@ -136,6 +215,57 @@ BOOT_PREFIX=$(WIN32_WRAPPER_PATH):$(BOOTSTRAP_ROOT)/bootstrap/bin: else BOOT_PREFIX=$(BOOTSTRAP_ROOT)/bootstrap/bin: endif + +# ---------------------------------------------------------------------- + +# The following is currently only used for determining what to prevent +# usage of during strict install or release. +include $(ERL_TOP)/make/$(TARGET)/otp_ded.mk +CC = @CC@ +LD = @LD@ +CXX = @CXX@ + +IBIN_DIR = $(ERL_TOP)/ibin +# +# If $(OTP_STRICT_INSTALL) equals `yes' we prefix the PATH with $(IBIN_DIR) +# when doing `release' or `install'. This directory contains `erlc', `gcc', +# `ld' etc, that unconditionally will fail if used. This is used during the +# daily builds in order to pick up on things being erroneously built during +# the `release' and `install' phases. +# +INST_FORBID = gcc g++ cc c++ cxx cl gcc.sh cc.sh ld ld.sh +INST_FORBID += javac.sh javac guavac gcj jikes bock +INST_FORBID += $(notdir $(CC)) $(notdir $(LD)) $(notdir $(CXX)) +INST_FORBID += $(notdir $(DED_CC)) $(notdir $(DED_LD)) +INST_FORBID += $(ERL_BASE_PUB_FILES) +IBIN_FILES = $(addprefix $(IBIN_DIR)/,$(sort $(INST_FORBID))) # sort will + # remove + # duplicates + +ifeq ($(OTP_STRICT_INSTALL),yes) + +INST_PATH_PREFIX=$(IBIN_DIR): +INST_DEP = strict_install +ifneq ($(CROSS_COMPILING),yes) +INST_DEP += strict_install_all_bootstraps +endif + +else # --- Normal case, i.e., not strict install --- + +# +# By default we allow build during install and release phase; therefore, +# make sure that the bootstrap system is available in the path. +# +INST_PATH_PREFIX=$(BOOT_PREFIX) +# If cross compiling `erlc', in path might have be used; therefore, +# avoid triggering a bootstrap build... +INST_DEP = +ifneq ($(CROSS_COMPILING),yes) +INST_DEP += all_bootstraps +endif + +endif # --- Normal case, i.e., not strict install --- + # ---------------------------------------------------------------------- # Fix up RELEASE_ROOT/TESTROOT havoc ifeq ($(RELEASE_ROOT),) @@ -164,13 +294,54 @@ endif # * build additional compilers and copy them into bootstrap/lib # * use the bootstrap erl and erlc to build all the libs # -all: all_bootstraps \ - libs local_setup dialyzer + +.PHONY: all bootstrap all_bootstraps + +ifneq ($(CROSS_COMPILING),yes) +# Not cross compiling + +ifeq ($(BOOTSTRAP_ONLY),yes) +all: bootstrap +else +# The normal case; not cross compiling, and not bootstrap only build. +all: bootstrap libs local_setup dialyzer +endif + +else +# Cross compiling + +all: cross_check_erl depend emulator libs start_scripts dialyzer + +endif + +cross_check_erl: + @PATH=$(BOOT_PREFIX)$${PATH} $(ERL_TOP)/make/cross_check_erl \ + -target $(TARGET) -otp $(OTP) -erl_top $(ERL_TOP) \ + -force $(ERL_XCOMP_FORCE_DIFFERENT_OTP) + +is_cross_configured: + @echo @CROSS_COMPILING@ + +target_configured: + @echo @TARGET@ + +bootstrap: depend all_bootstraps + + + +ifeq ($(OTP_STRICT_INSTALL),yes) + +.PHONY: strict_install_all_bootstraps + +strict_install_all_bootstraps: + $(MAKE) BOOT_PREFIX=$(INST_PATH_PREFIX) OTP_STRICT_INSTALL=$(OTP_STRICT_INSTALL) all_bootstraps + +endif # With all bootstraps we mean all bootstrapping that is done when # the system is delivered in open source, the primary # bootstrap is not included, it requires a pre built emulator... -all_bootstraps: depend emulator \ +all_bootstraps: emulator \ bootstrap_setup \ secondary_bootstrap_build secondary_bootstrap_copy \ tertiary_bootstrap_build tertiary_bootstrap_copy \ @@ -193,11 +364,15 @@ noboot_install: .PHONY: release release_docs -release: +release: $(INST_DEP) ifeq ($(OTP_SMALL_BUILD),true) - cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) release + cd $(ERL_TOP)/lib && \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ + $(MAKE) TESTROOT=$(RELEASE_ROOT) release else - cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release + cd $(ERL_TOP)/lib && \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ + $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ifneq ($(findstring vxworks,$(TARGET)),vxworks) @if test -f lib/dialyzer/SKIP ; then \ echo "=== Skipping dialyzer, reason:" ; \ @@ -205,23 +380,27 @@ ifneq ($(findstring vxworks,$(TARGET)),vxworks) echo "===" ; \ else \ cd $(ERL_TOP)/lib/dialyzer && \ - $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ + $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release ; \ fi endif endif - cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release + cd $(ERL_TOP)/erts && \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ + $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release # --------------------------------------------------------------- # Target only used when building commercial ERTS patches # --------------------------------------------------------------- -release_docs: +release_docs docs: ifeq ($(OTP_SMALL_BUILD),true) - cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) release_docs + cd $(ERL_TOP)/lib && $(MAKE) TESTROOT=$(RELEASE_ROOT) $@ else - cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release_docs - cd $(ERL_TOP)/lib/dialyzer && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release_docs + cd $(ERL_TOP)/lib && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@ + cd $(ERL_TOP)/lib/dialyzer && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@ endif - cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) release_docs + cd $(ERL_TOP)/erts && $(MAKE) BUILD_ALL=1 TESTROOT=$(RELEASE_ROOT) $@ + cd $(ERL_TOP)/system/doc && $(MAKE) TESTROOT=$(RELEASE_ROOT) $@ # ---------------------------------------------------------------------- @@ -352,7 +531,6 @@ secondary_bootstrap_copy: cp $$x $$TF; \ true; \ done - rm -f lib/hipe/ebin/*.beam # if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi @@ -441,6 +619,8 @@ fourth_bootstrap_copy: if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx ; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/ebin ; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/wx/include ; fi + if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server ; fi + if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include ; fi for x in lib/ic/ebin/*.beam; do \ BN=`basename $$x`; \ TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/ic/ebin/$$BN; \ @@ -506,6 +686,16 @@ fourth_bootstrap_copy: cp $$x $$TF; \ true; \ done + for x in lib/test_server/include/*.hrl; do \ + BN=`basename $$x`; \ + TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/test_server/include/$$BN; \ + test -f $$TF && \ + test '!' -z "`find $$x -newer $$TF -print`" && \ + cp $$x $$TF; \ + test '!' -f $$TF && \ + cp $$x $$TF; \ + true; \ + done # cp lib/syntax_tools/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/syntax_tools/ebin @@ -641,9 +831,13 @@ primary_bootstrap_copy: KERNEL_PRELOAD = otp_ring0 init erl_prim_loader prim_inet prim_file zlib prim_zip erlang KERNEL_PRELOAD_BEAMS=$(KERNEL_PRELOAD:%=$(BOOTSTRAP_TOP)/lib/kernel/ebin/%.beam) +start_scripts: + @cd erts/start_scripts \ + && ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} $(MAKE) script + # Creates "erl" and "erlc" scripts in bin/erl which uses the libraries in lib local_setup: - @rm -f erts/bin/erl erts/bin/erlc erts/bin/cerl + @rm -f bin/erl bin/erlc bin/cerl @cd erts && \ ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \ $(MAKE) local_setup @@ -716,21 +910,28 @@ bootstrap_nc_for_ne_no_debug_sym: # # Order is important here, don't change it! # -install: install.dirs install.emulator install.libs install.Install install.bin +INST_DEP += install.dirs install.emulator install.libs install.Install install.bin + +install: $(INST_DEP) + +install-docs: + ERL_TOP=$(ERL_TOP) INSTALLROOT=$(ERLANG_LIBDIR) PATH=$(BOOT_PREFIX)$${PATH} \ + $(MAKE) RELEASE_ROOT=$(ERLANG_LIBDIR) release_docs + install.emulator: cd erts && \ - ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release install.libs: ifeq ($(OTP_SMALL_BUILD),true) cd lib && \ - ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ $(MAKE) TESTROOT=$(ERLANG_LIBDIR) release else cd lib && \ - ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release @if test -f lib/dialyzer/SKIP ; then \ echo "=== Skipping dialyzer, reason:" ; \ @@ -738,22 +939,27 @@ else echo "===" ; \ else \ cd lib/dialyzer && \ - ERL_TOP=$(ERL_TOP) PATH=$(BOOT_PREFIX)$${PATH} \ + ERL_TOP=$(ERL_TOP) PATH=$(INST_PATH_PREFIX)$${PATH} \ $(MAKE) TESTROOT=$(ERLANG_LIBDIR) BUILD_ALL=true release ; \ fi endif install.Install: - cd $(ERLANG_LIBDIR) && ./Install -minimal $(ERLANG_LIBDIR) + (cd $(ERLANG_LIBDIR) \ + && ./Install $(INSTALL_CROSS) -minimal $(ERLANG_INST_LIBDIR)) # # Install erlang base public files # + install.bin: - for file in $(ERL_BASE_PUB_FILES); do \ - rm -f $(BINDIR)/$$file; \ - ${LN_S} $(ERLANG_BINDIR)/$$file $(BINDIR)/$$file; \ - done + @ DESTDIR="$(DESTDIR)" EXTRA_PREFIX="$(EXTRA_PREFIX)" \ + LN_S="$(LN_S)" BINDIR_SYMLINKS="$(BINDIR_SYMLINKS)" \ + $(ERL_TOP)/make/install_bin \ + --bindir "$(bindir)" \ + --erlang-bindir "$(erlang_bindir)" \ + --exec-prefix "$(exec_prefix)" \ + $(ERL_BASE_PUB_FILES) # # Directories needed before we can install @@ -763,6 +969,17 @@ install.dirs: ${MKSUBDIRS} $(ERLANG_LIBDIR) ${MKSUBDIRS} $(ERLANG_LIBDIR)/usr/lib +.PHONY: strict_install + +strict_install: $(IBIN_DIR) $(IBIN_FILES) + +$(IBIN_FILES): $(ERL_TOP)/make/unexpected_use + rm -f $@ + (cd $(dir $@) && $(LN_S) $(ERL_TOP)/make/unexpected_use $(notdir $@)) + +$(IBIN_DIR): + $(MKSUBDIRS) $@ + # ---------------------------------------------------------------------- .PHONY: clean eclean bootstrap_root_clean bootstrap_clean @@ -772,7 +989,7 @@ install.dirs: # clean: check_recreate_primary_bootstrap - rm -f *~ *.bak config.log config.status prebuilt.files + rm -f *~ *.bak config.log config.status prebuilt.files ibin/* find . -type f -name SKIP -print | xargs $(RM) cd erts && ERL_TOP=$(ERL_TOP) $(MAKE) clean cd lib && ERL_TOP=$(ERL_TOP) $(MAKE) clean BUILD_ALL=true |