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
|
|
|
|
|
|
|
|
# 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@
|
|
|
|
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@
|
2008-12-28 10:19:50 +00:00
|
|
|
|
2011-05-26 20:51:03 +00:00
|
|
|
# config options to push down to kconfig
|
2011-11-07 21:28:40 +00:00
|
|
|
KCONFIG:= @kconfig_options@
|
2011-05-26 20:51:03 +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
|
|
|
|
@echo "$< did changed: you must re-run './configure'"
|
|
|
|
@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
|
2008-06-11 21:45:57 +00:00
|
|
|
@echo " RM 'Makefile'"
|
2007-07-01 19:04:20 +00:00
|
|
|
@rm -f Makefile
|
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
mrproper: distclean
|
|
|
|
@echo " RM 'autostuff'"
|
|
|
|
@ rm -rf autom4te.cache config.log config.status configure
|
|
|
|
|
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) \
|
|
|
|
scripts/crosstool-NG.sh \
|
|
|
|
scripts/saveSample.sh \
|
2016-12-14 06:18:50 +00:00
|
|
|
scripts/showConfig.sh
|
2009-04-20 19:57:16 +00:00
|
|
|
@chmod 755 $^
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2012-01-16 22:36:42 +00:00
|
|
|
build-lib: config/configure.in \
|
|
|
|
paths.mk \
|
|
|
|
paths.sh
|
2012-01-14 17:22:06 +00:00
|
|
|
|
|
|
|
build-lib-kconfig:
|
|
|
|
@$(MAKE) -C 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
|
2008-06-11 21:45:57 +00:00
|
|
|
@echo " GZIP '$@'"
|
2007-08-07 17:10:07 +00:00
|
|
|
@gzip -c9 $< >$@
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-08-17 21:05:01 +00:00
|
|
|
define sed_it
|
2008-06-11 21:45:57 +00:00
|
|
|
@echo " SED '$@'"
|
2011-11-07 21:28:40 +00:00
|
|
|
@$(sed) -r -e 's,@@CT_BINDIR@@,$(bindir),g;' \
|
|
|
|
-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;' \
|
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
|
|
|
|
|
|
|
# We create a script fragment that is parseable from inside a Makefile,
|
2012-01-16 22:36:42 +00:00
|
|
|
# and one from inside a shell script
|
2011-05-26 20:51:03 +00:00
|
|
|
paths.mk: FORCE
|
2009-01-25 22:58:26 +00:00
|
|
|
@echo " GEN '$@'"
|
2012-01-16 22:36:42 +00:00
|
|
|
@(echo 'export install=$(install)'; \
|
|
|
|
echo 'export bash=$(bash)'; \
|
2012-07-14 16:25:47 +00:00
|
|
|
echo 'export awk=$(awk)'; \
|
2012-01-16 22:36:42 +00:00
|
|
|
echo 'export grep=$(grep)'; \
|
|
|
|
echo 'export make=$(make)'; \
|
|
|
|
echo 'export sed=$(sed)'; \
|
|
|
|
echo 'export libtool=$(libtool)'; \
|
|
|
|
echo 'export libtoolize=$(libtoolize)'; \
|
|
|
|
echo 'export objcopy=$(objcopy)'; \
|
|
|
|
echo 'export objdump=$(objdump)'; \
|
|
|
|
echo 'export readelf=$(readelf)'; \
|
|
|
|
echo 'export patch=$(patch)'; \
|
2013-09-14 01:45:23 +00:00
|
|
|
echo 'export gperf=$(gperf)'; \
|
2012-01-16 22:36:42 +00:00
|
|
|
) >$@
|
|
|
|
|
|
|
|
paths.sh: FORCE
|
|
|
|
@echo " GEN '$@'"
|
|
|
|
@(echo 'export install="$(install)"'; \
|
|
|
|
echo 'export bash="$(bash)"'; \
|
2012-07-14 16:25:47 +00:00
|
|
|
echo 'export awk="$(awk)"'; \
|
2012-01-16 22:36:42 +00:00
|
|
|
echo 'export grep="$(grep)"'; \
|
|
|
|
echo 'export make="$(make)"'; \
|
|
|
|
echo 'export sed="$(sed)"'; \
|
|
|
|
echo 'export libtool="$(libtool)"'; \
|
|
|
|
echo 'export libtoolize="$(libtoolize)"'; \
|
|
|
|
echo 'export objcopy="$(objcopy)"'; \
|
|
|
|
echo 'export objdump="$(objdump)"'; \
|
|
|
|
echo 'export readelf="$(readelf)"'; \
|
|
|
|
echo 'export patch="$(patch)"'; \
|
2013-09-14 01:45:23 +00:00
|
|
|
echo 'export gperf="$(gperf)"'; \
|
2012-01-16 22:36:42 +00:00
|
|
|
) >$@
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2011-05-26 20:51:03 +00:00
|
|
|
config/configure.in: FORCE
|
|
|
|
@echo " GEN '$@'"
|
|
|
|
@{ printf "# Generated file, do not edit\n"; \
|
|
|
|
printf "# Default values as found by ./configure\n"; \
|
|
|
|
for var in $(KCONFIG); do \
|
|
|
|
printf "\n"; \
|
|
|
|
printf "config CONFIGURE_$${var%%=*}\n"; \
|
|
|
|
if [ "$${var#*=}" = "y" ]; then \
|
2011-08-22 15:13:42 +00:00
|
|
|
printf " def_bool y\n"; \
|
|
|
|
else \
|
|
|
|
printf " bool\n"; \
|
2011-05-26 20:51:03 +00:00
|
|
|
fi; \
|
|
|
|
done; \
|
|
|
|
} >$@
|
|
|
|
|
|
|
|
FORCE:
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
#--------------------------------------
|
|
|
|
# Clean rules
|
|
|
|
|
|
|
|
clean-bin:
|
2011-08-19 20:53:48 +00:00
|
|
|
@echo " RM '$(PROG_NAME)'"
|
|
|
|
@rm -f $(PROG_NAME)
|
2009-05-13 21:32:48 +00:00
|
|
|
@echo " RM 'scripts/crosstool-NG.sh'"
|
2009-01-27 19:53:44 +00:00
|
|
|
@rm -f scripts/crosstool-NG.sh
|
2009-05-13 21:32:48 +00:00
|
|
|
@echo " RM 'scripts/saveSample.sh'"
|
2009-02-01 17:11:46 +00:00
|
|
|
@rm -f scripts/saveSample.sh
|
2016-12-14 06:18:50 +00:00
|
|
|
@echo " RM 'scripts/showConfig.sh'"
|
|
|
|
@rm -f scripts/showConfig.sh
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
clean-lib:
|
2012-01-16 22:36:42 +00:00
|
|
|
@echo " RM 'paths'"
|
|
|
|
@rm -f paths.mk paths.sh
|
2011-05-26 20:51:03 +00:00
|
|
|
@echo " RM 'config/configure.in'"
|
|
|
|
@rm -f config/configure.in
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2012-01-14 17:22:06 +00:00
|
|
|
clean-lib-kconfig:
|
|
|
|
@$(MAKE) -C kconfig clean
|
|
|
|
|
2007-07-01 19:04:20 +00:00
|
|
|
clean-doc:
|
2008-06-11 22:18:06 +00:00
|
|
|
|
|
|
|
clean-man:
|
2011-08-19 20:53:48 +00:00
|
|
|
@echo " RM 'docs/$(PROG_NAME).1'"
|
|
|
|
@rm -f docs/$(PROG_NAME).1
|
|
|
|
@echo " RM 'docs/$(PROG_NAME).1.gz'"
|
|
|
|
@rm -f 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)
|
2011-08-19 20:53:48 +00:00
|
|
|
@echo " INST '$(PROG_NAME)'"
|
2011-11-07 21:28:40 +00:00
|
|
|
@$(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
|
2011-11-07 21:28:40 +00:00
|
|
|
$(patsubst %,install-lib-%-copy,$(LIB_SUB_DIR)): $(DESTDIR)$(libdir)
|
2010-06-27 14:40:21 +00:00
|
|
|
@echo " INSTDIR '$(patsubst install-lib-%-copy,%,$(@))/'"
|
|
|
|
@tar cf - --exclude='*.sh.in' $(patsubst install-lib-%-copy,%,$(@)) \
|
2011-11-07 21:28:40 +00:00
|
|
|
|(cd "$(DESTDIR)$(libdir)"; tar xf -)
|
2010-06-27 14:40:21 +00:00
|
|
|
|
|
|
|
# Huh? It seems we need at least one command to make this rule kick-in.
|
|
|
|
install-lib-%: install-lib-%-copy; @true
|
|
|
|
|
|
|
|
# Huh? that one does not inherit the -opy dependency, above...
|
|
|
|
install-lib-scripts: install-lib-scripts-copy
|
2011-11-07 21:28:40 +00:00
|
|
|
@chmod a+x $(DESTDIR)$(libdir)/scripts/crosstool-NG.sh
|
|
|
|
@chmod a+x $(DESTDIR)$(libdir)/scripts/saveSample.sh
|
|
|
|
@rm -f "$(DESTDIR)$(libdir)/scripts/addToolVersion.sh"
|
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))
|
2010-06-27 14:40:21 +00:00
|
|
|
@echo " INST 'steps.mk'"
|
2011-11-07 21:28:40 +00:00
|
|
|
@$(install) -m 644 steps.mk "$(DESTDIR)$(libdir)/steps.mk"
|
2012-01-16 22:36:42 +00:00
|
|
|
@echo " INST 'paths'"
|
|
|
|
@$(install) -m 644 paths.mk 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
|
2010-06-27 14:40:21 +00:00
|
|
|
@echo " INSTDIR 'samples/'"
|
2011-07-31 18:44:10 +00:00
|
|
|
@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
|
|
|
KCONFIG_FILES := conf mconf nconf kconfig.mk
|
|
|
|
install-lib-kconfig: $(DESTDIR)$(libdir) install-lib-main
|
|
|
|
@echo " INST 'kconfig/'"
|
2012-11-06 16:02:06 +00:00
|
|
|
@mkdir -p "$(DESTDIR)$(libdir)/kconfig"
|
2012-01-14 17:22:06 +00:00
|
|
|
@for f in $(KCONFIG_FILES); do \
|
2012-11-06 16:02:06 +00:00
|
|
|
install "kconfig/$${f}" "$(DESTDIR)$(libdir)/kconfig/$${f}"; \
|
2012-01-14 17:22:06 +00:00
|
|
|
done
|
|
|
|
|
2011-11-07 21:28:40 +00:00
|
|
|
install-doc: $(DESTDIR)$(docdir)
|
2010-08-14 14:37:11 +00:00
|
|
|
@echo " INST 'docs/*.txt'"
|
|
|
|
@for doc_file in docs/*.txt; do \
|
2011-11-07 21:28:40 +00:00
|
|
|
$(install) -m 644 "$${doc_file}" "$(DESTDIR)$(docdir)"; \
|
2007-07-01 19:04:20 +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)
|
2011-08-19 20:53:48 +00:00
|
|
|
@echo " INST '$(PROG_NAME).1.gz'"
|
2011-11-07 21:28:40 +00:00
|
|
|
@$(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)):
|
2010-06-27 14:40:21 +00:00
|
|
|
@echo " MKDIR '$@/'"
|
2009-01-25 22:58:26 +00:00
|
|
|
@$(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:
|
2011-11-07 21:28:40 +00:00
|
|
|
@echo " RM '$(DESTDIR)$(bindir)/$(PROG_NAME)'"
|
|
|
|
@rm -f "$(DESTDIR)$(bindir)/$(PROG_NAME)"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-lib:
|
2011-11-07 21:28:40 +00:00
|
|
|
@echo " RMDIR '$(DESTDIR)$(libdir)/'"
|
|
|
|
@rm -rf "$(DESTDIR)$(libdir)"
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-doc:
|
2011-11-07 21:28:40 +00:00
|
|
|
@echo " RMDIR '$(DESTDIR)$(docdir)/'"
|
|
|
|
@rm -rf "$(DESTDIR)$(docdir)"
|
2007-07-28 20:45:24 +00:00
|
|
|
|
2008-06-11 21:45:57 +00:00
|
|
|
uninstall-man:
|
2011-11-07 21:28:40 +00:00
|
|
|
@echo " RM '$(DESTDIR)$(mandir)$(MAN_SUBDIR)/$(PROG_NAME).1.gz'"
|
|
|
|
@rm -f "$(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
|