mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-21 05:43:09 +00:00
Re-instate the --local configure switch to not install and use the local crosstool-NG copy.
This commit is contained in:
parent
787be08150
commit
f38b71646a
24
Makefile.in
24
Makefile.in
@ -12,14 +12,15 @@ LIBDIR := @@LIBDIR@@
|
||||
DOCDIR := @@DOCDIR@@
|
||||
MANDIR := @@MANDIR@@
|
||||
DATE := @@DATE@@
|
||||
MAKE := $(shell which make || type -p make || echo /usr/bin/make)
|
||||
LOCAL := @@LOCAL@@
|
||||
MAKE := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
|
||||
|
||||
###############################################################################
|
||||
# Global make rules
|
||||
|
||||
build: build-bin build-lib build-doc
|
||||
|
||||
install: build install-bin install-lib install-doc
|
||||
install: install-local-test build install-bin install-lib install-doc
|
||||
|
||||
clean: clean-bin clean-lib clean-doc
|
||||
|
||||
@ -66,13 +67,20 @@ clean-doc:
|
||||
#--------------------------------------
|
||||
# Install rules
|
||||
|
||||
install-bin: $(BINDIR)
|
||||
# If using localy, don't install
|
||||
install-local-test:
|
||||
@if [ "$(LOCAL)" = "1" ]; then \
|
||||
echo "You're using local copy as runtime. You can't install."; \
|
||||
false; \
|
||||
fi
|
||||
|
||||
install-bin: install-local-test $(BINDIR)
|
||||
@echo " INST ct-ng"
|
||||
@install -m 755 ct-ng $(BINDIR)/ct-ng
|
||||
|
||||
install-lib: $(LIBDIR) install-lib-main install-lib-samples
|
||||
install-lib: install-local-test $(LIBDIR) install-lib-main install-lib-samples
|
||||
|
||||
install-lib-main: $(LIBDIR)
|
||||
install-lib-main: install-local-test $(LIBDIR)
|
||||
@for src_dir in config kconfig patches scripts tools; do \
|
||||
echo " INST $${src_dir}/"; \
|
||||
tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
|
||||
@ -85,20 +93,20 @@ install-lib-main: $(LIBDIR)
|
||||
|
||||
# Samples need a little love:
|
||||
# - change every occurence of CT_TOP_DIR to CT_LIB_DIR
|
||||
install-lib-samples: $(LIBDIR) install-lib-main
|
||||
install-lib-samples: install-local-test $(LIBDIR) install-lib-main
|
||||
@echo " INST samples/"
|
||||
@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
|
||||
@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do \
|
||||
sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
|
||||
done
|
||||
|
||||
install-doc: install-man $(DOCDIR)
|
||||
install-doc: install-local-test $(DOCDIR)
|
||||
@for doc_file in CREDITS docs/overview.txt; do \
|
||||
echo " INST $${doc_file}"; \
|
||||
install -m 644 "$${doc_file}" $(DOCDIR); \
|
||||
done
|
||||
|
||||
install-man: $(MANDIR)
|
||||
install-man: install-local-test $(MANDIR)
|
||||
@echo " INST ct-ng.1"
|
||||
@install -m 644 docs/ct-ng.1 $(MANDIR)
|
||||
|
||||
|
11
configure
vendored
11
configure
vendored
@ -9,6 +9,7 @@ BINDIR_set=
|
||||
LIBDIR_set=
|
||||
DOCDIR_set=
|
||||
MANDIR_set=
|
||||
LOCAL_set=
|
||||
|
||||
get_optval(){
|
||||
local ret
|
||||
@ -79,6 +80,7 @@ Defaults for the options are specified in brackets.
|
||||
Configuration:
|
||||
-h, --help display this help and exit
|
||||
--prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
|
||||
--local don't install, and use current directory
|
||||
|
||||
By default, \`make install' will install all the files in
|
||||
\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
|
||||
@ -102,12 +104,20 @@ while [ $# -ne 0 ]; do
|
||||
--libdir*) set_libdir "$1" "$2" && shift || shift 2;;
|
||||
--docdir*) set_docdir "$1" "$2" && shift || shift 2;;
|
||||
--mandir*) set_mandir "$1" "$2" && shift || shift 2;;
|
||||
--local) LOCAL_set=1; shift;;
|
||||
--help|-h) do_help; exit 0;;
|
||||
*) do_help; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -z "${PREFIX}" ] && set_prefix "" "${PREFIX_DEFAULT}"
|
||||
if [ "${LOCAL_set}" = "1" ]; then
|
||||
set_prefix "" $(pwd)
|
||||
set_bindir "" $(pwd)
|
||||
set_libdir "" $(pwd)
|
||||
set_docdir "" $(pwd)/docs
|
||||
set_mandir "" $(pwd)/docs
|
||||
fi
|
||||
|
||||
sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
|
||||
-e "s,@@LIBDIR@@,${LIBDIR},g;" \
|
||||
@ -115,6 +125,7 @@ sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
|
||||
-e "s,@@MANDIR@@,${MANDIR},g;" \
|
||||
-e "s,@@VERSION@@,${VERSION},g;" \
|
||||
-e "s,@@DATE@@,${DATE},g;" \
|
||||
-e "s,@@LOCAL@@,${LOCAL_set},g;" \
|
||||
Makefile.in >Makefile
|
||||
|
||||
cat <<__EOF__
|
||||
|
2
ct-ng.in
2
ct-ng.in
@ -3,7 +3,7 @@
|
||||
# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
|
||||
|
||||
# Don't print directory as we descend into them
|
||||
MAKEFLAGS += --no-print-directory
|
||||
MAKEFLAGS += --no-print-directory --no-builtin-rules
|
||||
|
||||
# Remember the name of the Makefile
|
||||
CT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
||||
|
@ -82,7 +82,7 @@ help-config::
|
||||
|
||||
# Cheesy build
|
||||
|
||||
SHIPPED = $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
|
||||
SHIPPED := $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
|
||||
|
||||
%.c: %.c_shipped
|
||||
@ln -s $(notdir $<) $@
|
||||
@ -101,9 +101,7 @@ $(obj)/conf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c
|
||||
|
||||
clean::
|
||||
@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
|
||||
@rm -f $(SHIPPED)
|
||||
@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
|
||||
@rm -f $(CT_TOP_DIR)/config
|
||||
@rm -f $(CT_TOP_DIR)/config 2>/dev/null || true
|
||||
@rm -rf $(CT_TOP_DIR)/config.gen
|
||||
|
||||
distclean::
|
||||
@rm -f $(CT_TOP_DIR)/config
|
||||
|
Loading…
Reference in New Issue
Block a user