2007-07-02 19:40:54 +00:00
|
|
|
# Makefile.in for building crosstool-NG
|
2007-07-01 19:04:20 +00:00
|
|
|
# This file serves as source for the ./configure operation
|
|
|
|
|
2009-01-26 22:43:08 +00:00
|
|
|
# This series of test is here because GNU make 3.81 will *not* use MAKEFLAGS
|
|
|
|
# to set additional flags in the current Makfile ( see:
|
|
|
|
# http://savannah.gnu.org/bugs/?20501 ), although the make manual says it
|
|
|
|
# should ( see: http://www.gnu.org/software/make/manual/make.html#Options_002fRecursion )
|
|
|
|
# so we have to work it around by calling ourselves back if needed
|
|
|
|
|
|
|
|
# So why do we need not to use the built rules and variables? Because we
|
|
|
|
# need to generate scripts/crosstool-NG.sh from scripts/crosstool-NG.sh.in
|
|
|
|
# and there is a built-in implicit rule '%.sh:' that has neither a pre-requisite
|
|
|
|
# nor a command associated, and that built-in implicit rule takes precedence
|
|
|
|
# over our non-built-in implicit rule '%: %.in', below.
|
|
|
|
|
|
|
|
# CT_MAKEFLAGS will be used later, below...
|
|
|
|
|
|
|
|
# Do not print directories as we descend into them
|
|
|
|
ifeq ($(filter --no-print-directory,$(MAKEFLAGS)),)
|
|
|
|
CT_MAKEFLAGS += --no-print-directory
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Use neither builtin rules, nor builtin variables
|
|
|
|
# Note: dual test, because if -R and -r are given on the command line
|
|
|
|
# (who knows?), MAKEFLAGS contains 'Rr' instead of '-Rr', while adding
|
|
|
|
# '-Rr' to MAKEFLAGS adds it literaly ( and does not add 'Rr' )
|
2013-07-10 11:40:21 +00:00
|
|
|
# Further: quad test because the flags 'rR' and '-rR' can be reordered.
|
2009-01-26 22:43:08 +00:00
|
|
|
ifeq ($(filter Rr,$(MAKEFLAGS)),)
|
|
|
|
ifeq ($(filter -Rr,$(MAKEFLAGS)),)
|
2013-07-10 11:40:21 +00:00
|
|
|
ifeq ($(filter rR,$(MAKEFLAGS)),)
|
|
|
|
ifeq ($(filter -rR,$(MAKEFLAGS)),)
|
2009-01-26 22:43:08 +00:00
|
|
|
CT_MAKEFLAGS += -Rr
|
2013-07-10 11:40:21 +00:00
|
|
|
endif # No -rR
|
|
|
|
endif # No rR
|
2009-01-26 22:43:08 +00:00
|
|
|
endif # No -Rr
|
|
|
|
endif # No Rr
|
|
|
|
|
2017-01-13 00:53:28 +00:00
|
|
|
# Helper: print abbreviation of the command by default, or full command
|
|
|
|
# if doing 'make V=1'.
|
|
|
|
__silent = $(if $(V),,@printf ' %-7s %s\n' '$1' '$(if $2,$2,$(strip $<))' && )
|
|
|
|
__silent_rm = $(call __silent,RM,$1)rm -f $1
|
|
|
|
__silent_rmdir = $(call __silent,RMDIR,$1)rm -rf $1
|
|
|
|
|
2009-01-26 22:43:08 +00:00
|
|
|
# Remove any suffix rules
|
|
|
|
.SUFFIXES:
|
2008-06-11 21:45:57 +00:00
|
|
|
|
2007-09-14 21:13:04 +00:00
|
|
|
all: Makefile build
|
|
|
|
|
2008-12-28 10:19:50 +00:00
|
|
|
###############################################################################
|
|
|
|
# Configuration variables
|
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
# Stuff found by ./configure
|
2012-01-14 17:22:06 +00:00
|
|
|
export DATE := @DATE@
|
|
|
|
export LOCAL := @enable_local@
|
|
|
|
export PROG_SED := @program_transform_name@
|
|
|
|
export PACKAGE_TARNAME := @PACKAGE_TARNAME@
|
|
|
|
export VERSION := @PACKAGE_VERSION@
|
|
|
|
export prefix := @prefix@
|
|
|
|
export exec_prefix := @exec_prefix@
|
|
|
|
export bindir := @bindir@
|
|
|
|
export libdir := @libdir@@sublibdir@
|
|
|
|
export docdir := @docdir@@subdocdir@
|
|
|
|
export mandir := @mandir@
|
|
|
|
export datarootdir := @datarootdir@
|
|
|
|
export install := @INSTALL@
|
Rework configure logic wrt GNU autotools
Rather than requiring them of a certain version, detect if they are present
(and have sufficient version) and select an appropriate companion tool
otherwise. The reason is that, for example, most recent gettext requires
automake 1.15, but the newest available CentOS has 1.13. Hence, the option
to "upgrade your system" does not apply, and the warning comment above
the companion tools is rather scary.
With this approach, it will work out of the box - either by using the host's
tools, or by building them as needed. Note that the user can still change
the setting in the config.
While there, propagate the new version checking macro to awk/bash/host binutils,
and switch from --with-foo=xxx to officially blessed FOO=xxx: the latter
does not require checking for bogus values (i.e., --with-foo, --without-foo)
and AC_PROG_* macros recognize the corresponding settings without further
modifications. For now, I kept --with-foo=, if only to complain and steer
people to the new way. To be cleaned up after a release.
Signed-off-by: Alexey Neyman <stilor@att.net>
2017-01-27 05:05:17 +00:00
|
|
|
export bash := @BASH_SHELL@
|
|
|
|
export awk := @AWK@
|
2012-01-16 23:37:59 +00:00
|
|
|
export grep := @GREP@
|
2012-01-14 17:22:06 +00:00
|
|
|
export make := @MAKE@
|
|
|
|
export sed := @SED@
|
2017-02-12 21:51:42 +00:00
|
|
|
export wget := @wget@
|
|
|
|
export curl := @curl@
|
2012-01-14 17:22:06 +00:00
|
|
|
export libtool := @LIBTOOL@
|
|
|
|
export libtoolize := @LIBTOOLIZE@
|
|
|
|
export objcopy := @OBJCOPY@
|
|
|
|
export objdump := @OBJDUMP@
|
|
|
|
export readelf := @READELF@
|
|
|
|
export patch := @PATCH@
|
2013-09-14 01:45:23 +00:00
|
|
|
export gperf := @GPERF@
|
2017-01-13 01:35:35 +00:00
|
|
|
export gperf_len_type := @GPERF_LEN_TYPE@
|
2012-01-14 17:22:06 +00:00
|
|
|
export CC := @CC@
|
|
|
|
export CPP := @CPP@
|
|
|
|
export CPPFLAGS := @CPPFLAGS@
|
|
|
|
export CFLAGS := @CFLAGS@
|
|
|
|
export LDFLAGS := @LDFLAGS@
|
|
|
|
export LIBS := @LIBS@
|
2015-11-06 00:20:16 +00:00
|
|
|
export INTL_LIBS := @INTL_LIBS@
|
2012-01-14 17:22:06 +00:00
|
|
|
export curses_hdr := @ac_ct_curses_hdr@
|
|
|
|
export gettext := @gettext@
|
2017-03-02 04:22:13 +00:00
|
|
|
export CPU_COUNT := @CPU_COUNT@
|
2008-12-28 10:19:50 +00:00
|
|
|
|
2010-07-15 20:34:31 +00:00
|
|
|
###############################################################################
|
|
|
|
# Non-configure variables
|
|
|
|
MAN_SECTION := 1
|
|
|
|
MAN_SUBDIR := /man$(MAN_SECTION)
|
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
PROG_NAME := $(shell echo 'ct-ng' |$(sed) -r -e '$(PROG_SED)' )
|
2011-08-19 20:53:48 +00:00
|
|
|
|
2008-11-16 21:55:46 +00:00
|
|
|
###############################################################################
|
|
|
|
# Sanity checks
|
|
|
|
|
2007-09-14 21:13:04 +00:00
|
|
|
# Check if Makefile is up to date:
|
|
|
|
Makefile: Makefile.in
|
2017-01-13 00:53:28 +00:00
|
|
|
@echo "$< changed: you must re-run './configure'"
|
2007-09-14 21:13:04 +00:00
|
|
|
@false
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-11-16 21:55:46 +00:00
|
|
|
# If installing with DESTDIR, check it's an absolute path
|
|
|
|
ifneq ($(strip $(DESTDIR)),)
|
|
|
|
ifneq ($(DESTDIR),$(abspath /$(DESTDIR)))
|
|
|
|
$(error DESTDIR is not an absolute PATH: '$(DESTDIR)')
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
###############################################################################
|
|
|
|
# Global make rules
|
|
|
|
|
2009-01-26 22:43:08 +00:00
|
|
|
# If any extra MAKEFLAGS were added, re-run ourselves
|
|
|
|
# See top of file for an explanation of why this is needed...
|
|
|
|
ifneq ($(strip $(CT_MAKEFLAGS)),)
|
|
|
|
|
2011-06-04 15:43:49 +00:00
|
|
|
# Somehow, the new auto-completion for make in the recent distributions
|
|
|
|
# trigger a behavior where our Makefile calls itself recursively, in a
|
|
|
|
# never-ending loop (except on lack of ressources, swap, PIDs...)
|
|
|
|
# Avoid this situation by cutting the recursion short at the first
|
|
|
|
# level.
|
|
|
|
# This has the side effect of only showing the real targets, and hiding our
|
|
|
|
# internal ones. :-)
|
|
|
|
ifneq ($(MAKELEVEL),0)
|
|
|
|
$(error Recursion detected, bailing out...)
|
|
|
|
endif
|
|
|
|
|
2009-01-26 22:43:08 +00:00
|
|
|
MAKEFLAGS += $(CT_MAKEFLAGS)
|
2011-11-07 21:28:40 +00:00
|
|
|
build install clean distclean mrproper uninstall:
|
2009-01-26 22:43:08 +00:00
|
|
|
@$(MAKE) $@
|
|
|
|
|
|
|
|
else
|
|
|
|
# There were no additional MAKEFLAGS to add, do the job
|
|
|
|
|
2012-01-14 17:22:06 +00:00
|
|
|
TARGETS := bin lib lib-kconfig doc man
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 22:18:06 +00:00
|
|
|
build: $(patsubst %,build-%,$(TARGETS))
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-12-16 18:12:34 +00:00
|
|
|
install: build real-install
|
2008-06-11 22:18:06 +00:00
|
|
|
|
|
|
|
clean: $(patsubst %,clean-%,$(TARGETS))
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
distclean: clean
|
2017-04-29 04:26:28 +00:00
|
|
|
$(call __silent_rm,Makefile config/configure.in)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
mrproper: distclean
|
2017-04-29 04:26:28 +00:00
|
|
|
$(call __silent_rmdir,autom4te.cache config/gen)
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rm,config.log config.status configure)
|
2011-11-07 21:28:40 +00:00
|
|
|
|
2008-11-16 22:19:57 +00:00
|
|
|
uninstall: real-uninstall
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Specific make rules
|
|
|
|
|
|
|
|
#--------------------------------------
|
|
|
|
# Build rules
|
|
|
|
|
2012-01-14 17:22:06 +00:00
|
|
|
build-bin: $(PROG_NAME) \
|
2017-02-12 21:51:42 +00:00
|
|
|
scripts/scripts.mk \
|
2012-01-14 17:22:06 +00:00
|
|
|
scripts/crosstool-NG.sh \
|
|
|
|
scripts/saveSample.sh \
|
2016-12-14 06:18:50 +00:00
|
|
|
scripts/showConfig.sh
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,CHMOD,$^)chmod 755 $^
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2017-04-22 19:28:50 +00:00
|
|
|
build-lib: paths.mk \
|
2012-01-16 22:36:42 +00:00
|
|
|
paths.sh
|
2012-01-14 17:22:06 +00:00
|
|
|
|
|
|
|
build-lib-kconfig:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,ENTER,kconfig)$(MAKE) -C kconfig
|
|
|
|
$(call __silent,LEAVE,kconfig):
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 22:18:06 +00:00
|
|
|
build-doc:
|
|
|
|
|
2011-08-19 20:53:48 +00:00
|
|
|
build-man: docs/$(PROG_NAME).1.gz
|
2007-07-30 21:23:53 +00:00
|
|
|
|
2011-08-19 20:53:48 +00:00
|
|
|
docs/$(PROG_NAME).1.gz: docs/$(PROG_NAME).1
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,GZIP)gzip -c9 $< >$@
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-08-17 21:05:01 +00:00
|
|
|
define sed_it
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,SED,$@)$(sed) -r \
|
|
|
|
-e 's,@@CT_BINDIR@@,$(bindir),g;' \
|
2011-11-07 21:28:40 +00:00
|
|
|
-e 's,@@CT_LIBDIR@@,$(libdir),g;' \
|
|
|
|
-e 's,@@CT_DOCDIR@@,$(docdir),g;' \
|
|
|
|
-e 's,@@CT_MANDIR@@,$(mandir),g;' \
|
2011-08-17 21:05:01 +00:00
|
|
|
-e 's,@@CT_PROG_NAME@@,$(PROG_NAME),g;' \
|
|
|
|
-e 's,@@CT_VERSION@@,$(VERSION),g;' \
|
|
|
|
-e 's,@@CT_DATE@@,$(DATE),g;' \
|
|
|
|
-e 's,@@CT_make@@,$(make),g;' \
|
|
|
|
-e 's,@@CT_bash@@,$(bash),g;' \
|
2012-07-14 16:25:47 +00:00
|
|
|
-e 's,@@CT_awk@@,$(awk),g;' \
|
2017-02-12 21:51:42 +00:00
|
|
|
-e 's,@@CT_wget@@,$(wget),g;' \
|
|
|
|
-e 's,@@CT_curl@@,$(curl),g;' \
|
2017-03-02 04:22:13 +00:00
|
|
|
-e 's,@@CT_cpucount@@,$(CPU_COUNT),g;' \
|
2011-08-17 21:05:01 +00:00
|
|
|
$< >$@
|
|
|
|
endef
|
|
|
|
|
2011-08-19 20:43:01 +00:00
|
|
|
docs/$(PROG_NAME).1: docs/ct-ng.1.in Makefile
|
|
|
|
$(call sed_it)
|
|
|
|
|
2011-08-21 21:11:26 +00:00
|
|
|
$(PROG_NAME): ct-ng.in Makefile
|
2011-08-17 21:05:01 +00:00
|
|
|
$(call sed_it)
|
|
|
|
|
|
|
|
%: %.in Makefile
|
|
|
|
$(call sed_it)
|
2009-01-25 22:58:26 +00:00
|
|
|
|
2017-02-27 04:42:32 +00:00
|
|
|
__paths_vars = install bash awk grep make sed libtool \
|
|
|
|
libtoolize objcopy objdump readelf patch gperf
|
|
|
|
|
2009-01-25 22:58:26 +00:00
|
|
|
# We create a script fragment that is parseable from inside a Makefile,
|
2017-02-27 04:42:32 +00:00
|
|
|
# and one from inside a shell script.
|
2011-05-26 20:51:03 +00:00
|
|
|
paths.mk: FORCE
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,GEN,$@){ $(foreach w,$(__paths_vars),$(if $($w),echo 'export $w=$(subst ','\'',$($w))';)) :; } >$@
|
2012-01-16 22:36:42 +00:00
|
|
|
|
|
|
|
paths.sh: FORCE
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,GEN,$@){ $(foreach w,$(__paths_vars),$(if $($w),echo 'export $w="$(subst ','\'',$($w))"';)) :; } >$@
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-05-26 20:51:03 +00:00
|
|
|
FORCE:
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
#--------------------------------------
|
|
|
|
# Clean rules
|
|
|
|
|
|
|
|
clean-bin:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rm,$(PROG_NAME))
|
|
|
|
$(call __silent_rm,scripts/scripts.mk)
|
|
|
|
$(call __silent_rm,scripts/crosstool-NG.sh)
|
2017-04-29 04:26:28 +00:00
|
|
|
$(call __silent_rm,scripts/saveSample.sh)
|
|
|
|
$(call __silent_rm,scripts/showConfig.sh)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
clean-lib:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rm,paths.mk paths.sh)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2012-01-14 17:22:06 +00:00
|
|
|
clean-lib-kconfig:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,ENTER,kconfig)$(MAKE) -C kconfig clean
|
|
|
|
$(call __silent,LEAVE,kconfig):
|
2012-01-14 17:22:06 +00:00
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
clean-doc:
|
2008-06-11 22:18:06 +00:00
|
|
|
|
|
|
|
clean-man:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rm,docs/$(PROG_NAME).1)
|
|
|
|
$(call __silent_rm,docs/$(PROG_NAME).1.gz)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
#--------------------------------------
|
2008-06-11 21:45:57 +00:00
|
|
|
# Check for --local setup
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
ifeq ($(strip $(LOCAL)),yes)
|
2008-11-16 22:19:57 +00:00
|
|
|
|
2008-12-16 18:12:34 +00:00
|
|
|
real-install:
|
2009-04-20 19:57:16 +00:00
|
|
|
@true
|
2008-11-16 22:19:57 +00:00
|
|
|
|
|
|
|
real-uninstall:
|
|
|
|
@true
|
|
|
|
|
|
|
|
else
|
2007-07-22 17:44:27 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
#--------------------------------------
|
|
|
|
# Install rules
|
|
|
|
|
2010-04-01 22:18:26 +00:00
|
|
|
real-install: $(patsubst %,install-%,$(TARGETS)) install-post
|
2008-11-16 22:19:57 +00:00
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
install-bin: $(DESTDIR)$(bindir)
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,INST,$(PROG_NAME))$(install) -m 755 $(PROG_NAME) "$(DESTDIR)$(bindir)/$(PROG_NAME)"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 22:18:06 +00:00
|
|
|
# If one is hacking crosstool-NG, the patch set might change between any two
|
|
|
|
# installations of the same VERSION, thus the patches must be removed prior
|
2013-02-25 20:19:31 +00:00
|
|
|
# to being installed. It is the responsibility of the user to call uninstall
|
|
|
|
# first, if (s)he deems it necessary
|
|
|
|
install-lib: $(DESTDIR)$(libdir) \
|
2012-01-14 17:22:06 +00:00
|
|
|
install-lib-main \
|
|
|
|
install-lib-samples
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2012-01-14 17:22:06 +00:00
|
|
|
LIB_SUB_DIR := config contrib patches scripts
|
2017-01-13 00:53:28 +00:00
|
|
|
$(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): install-lib-%-copy: $(DESTDIR)$(libdir)
|
2017-04-23 06:35:05 +00:00
|
|
|
$(call __silent,INSTDIR,$*)tar cf - --exclude='*.sh.in' --exclude='*.in.in' $* \
|
2011-11-07 21:28:40 +00:00
|
|
|
|(cd "$(DESTDIR)$(libdir)"; tar xf -)
|
2010-06-27 14:40:21 +00:00
|
|
|
|
2017-01-13 00:53:28 +00:00
|
|
|
# Dependency-only by default.
|
|
|
|
$(patsubst %,install-lib-%,$(LIB_SUB_DIR)): install-lib-%: install-lib-%-copy
|
2010-06-27 14:40:21 +00:00
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
install-lib-main: $(DESTDIR)$(libdir) $(patsubst %,install-lib-%,$(LIB_SUB_DIR))
|
2017-04-23 06:35:05 +00:00
|
|
|
$(call __silent,INST,steps.mk)$(install) -m 644 steps.mk "$(DESTDIR)$(libdir)"
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,INST,paths.mk)$(install) -m 644 paths.mk "$(DESTDIR)$(libdir)"
|
|
|
|
$(call __silent,INST,paths.sh)$(install) -m 644 paths.sh "$(DESTDIR)$(libdir)"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
# Samples need a little love:
|
2008-02-14 22:44:34 +00:00
|
|
|
# - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
|
2011-11-07 21:28:40 +00:00
|
|
|
install-lib-samples: $(DESTDIR)$(libdir) install-lib-main
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,INSTDIR,samples)for samp_dir in samples/*/; do \
|
2011-11-07 21:28:40 +00:00
|
|
|
mkdir -p "$(DESTDIR)$(libdir)/$${samp_dir}"; \
|
2011-04-28 21:36:37 +00:00
|
|
|
$(sed) -r -e 's:\$$\{CT_TOP_DIR\}:\$$\{CT_LIB_DIR\}:;' \
|
|
|
|
-e 's:^(CT_WORK_DIR)=.*:\1="\$${CT_TOP_DIR}/.build":;' \
|
2011-07-31 18:44:10 +00:00
|
|
|
$${samp_dir}/crosstool.config \
|
2011-11-07 21:28:40 +00:00
|
|
|
>"$(DESTDIR)$(libdir)/$${samp_dir}/crosstool.config"; \
|
2011-07-31 18:44:10 +00:00
|
|
|
$(install) -m 644 "$${samp_dir}/reported.by" \
|
2011-11-07 21:28:40 +00:00
|
|
|
"$(DESTDIR)$(libdir)/$${samp_dir}"; \
|
2011-07-31 18:44:10 +00:00
|
|
|
for libc_cfg in "$${samp_dir}/"*libc*.config; do \
|
|
|
|
[ -f "$${libc_cfg}" ] || continue; \
|
|
|
|
$(install) -m 644 "$${libc_cfg}" \
|
2011-11-07 21:28:40 +00:00
|
|
|
"$(DESTDIR)$(libdir)/$${samp_dir}"; \
|
2011-07-31 18:44:10 +00:00
|
|
|
done; \
|
2016-05-26 14:22:42 +00:00
|
|
|
[ -e "$${samp_dir}/broken" ] && \
|
|
|
|
$(install) -m 644 "$${samp_dir}/broken" \
|
|
|
|
"$(DESTDIR)$(libdir)/$${samp_dir}/" || :; \
|
2007-07-01 19:04:20 +00:00
|
|
|
done
|
2011-11-07 21:28:40 +00:00
|
|
|
@$(install) -m 644 samples/samples.mk "$(DESTDIR)$(libdir)/samples/samples.mk"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2012-01-14 17:22:06 +00:00
|
|
|
install-lib-kconfig: $(DESTDIR)$(libdir) install-lib-main
|
2017-04-29 04:14:24 +00:00
|
|
|
$(call __silent,MKDIR,$@)$(install) -m 755 -d "$(DESTDIR)$(libdir)/kconfig"
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,ENTER,kconfig)$(MAKE) -C kconfig install \
|
|
|
|
DESTDIR=$(DESTDIR)$(libdir)/kconfig
|
|
|
|
$(call __silent,LEAVE,kconfig):
|
2012-01-14 17:22:06 +00:00
|
|
|
|
2017-03-21 05:25:44 +00:00
|
|
|
install-doc: install-doc-$(if $(wildcard docs/MANUAL_ONLINE),message,real)
|
|
|
|
|
|
|
|
install-doc-message:
|
|
|
|
@echo "********************************************************************"
|
|
|
|
@echo " You are building from a development version that does not include"
|
|
|
|
@echo " the documentation. Refer to the manual online at:"
|
|
|
|
@echo " http://crosstool-ng.github.io/docs"
|
|
|
|
@echo "********************************************************************"
|
|
|
|
|
|
|
|
install-doc-real: $(DESTDIR)$(docdir)
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,INST,docs)for doc_file in docs/manual/*.md; do \
|
2011-11-07 21:28:40 +00:00
|
|
|
$(install) -m 644 "$${doc_file}" "$(DESTDIR)$(docdir)"; \
|
2017-01-13 00:53:28 +00:00
|
|
|
done
|
2007-07-14 10:19:01 +00:00
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
install-man: $(DESTDIR)$(mandir)$(MAN_SUBDIR)
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,INST,$(PROG_NAME).1.gz)$(install) -m 644 docs/$(PROG_NAME).1.gz "$(DESTDIR)$(mandir)$(MAN_SUBDIR)"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
$(sort $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(docdir) $(DESTDIR)$(mandir)$(MAN_SUBDIR)):
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent,MKDIR,$@)$(install) -m 755 -d "$@"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2010-04-01 22:18:26 +00:00
|
|
|
install-post:
|
|
|
|
@echo
|
2011-08-19 20:53:48 +00:00
|
|
|
@echo "For auto-completion, do not forget to install '$(PROG_NAME).comp' into"
|
2010-06-27 14:40:21 +00:00
|
|
|
@echo "your bash completion directory (usually /etc/bash_completion.d)"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
#--------------------------------------
|
|
|
|
# Uninstall rules
|
|
|
|
|
2015-11-19 22:30:20 +00:00
|
|
|
real-uninstall: $(patsubst %,uninstall-%,$(filter-out lib-kconfig,$(TARGETS)))
|
2008-11-16 22:19:57 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-bin:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rm,$(DESTDIR)$(bindir)/$(PROG_NAME))
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-lib:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rmdir,$(DESTDIR)$(libdir))
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-doc:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rmdir,$(DESTDIR)$(docdir))
|
2007-07-28 20:45:24 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-man:
|
2017-01-13 00:53:28 +00:00
|
|
|
$(call __silent_rm,$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1.gz)
|
2008-11-16 22:19:57 +00:00
|
|
|
|
|
|
|
endif # Not --local
|
2009-01-26 22:43:08 +00:00
|
|
|
|
|
|
|
endif # No extra MAKEFLAGS were added
|
2011-09-28 23:27:54 +00:00
|
|
|
|
|
|
|
.PHONY: build $(patsubst %,build-%,$(TARGETS)) install
|