# HG changeset patch # User "Yann E. MORIN" # Date 1185126267 0 # Node ID 148f0a31e2d858b8f61552bacbfdd5dbbb5e2b73 # Parent 23ae4aebb94cc98930c329431b84008a138da072 Re-instate the --local configure switch to not install and use the local crosstool-NG copy. diff -r 23ae4aebb94c -r 148f0a31e2d8 Makefile.in --- a/Makefile.in Sun Jul 22 16:36:20 2007 +0000 +++ b/Makefile.in Sun Jul 22 17:44:27 2007 +0000 @@ -12,14 +12,15 @@ 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 @@ #-------------------------------------- # 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 @@ # 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) diff -r 23ae4aebb94c -r 148f0a31e2d8 configure --- a/configure Sun Jul 22 16:36:20 2007 +0000 +++ b/configure Sun Jul 22 17:44:27 2007 +0000 @@ -9,6 +9,7 @@ LIBDIR_set= DOCDIR_set= MANDIR_set= +LOCAL_set= get_optval(){ local ret @@ -79,6 +80,7 @@ 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 @@ --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 @@ -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__ diff -r 23ae4aebb94c -r 148f0a31e2d8 ct-ng.in --- a/ct-ng.in Sun Jul 22 16:36:20 2007 +0000 +++ b/ct-ng.in Sun Jul 22 17:44:27 2007 +0000 @@ -3,7 +3,7 @@ # Copyright 2006 Yann E. MORIN # 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)) diff -r 23ae4aebb94c -r 148f0a31e2d8 kconfig/kconfig.mk --- a/kconfig/kconfig.mk Sun Jul 22 16:36:20 2007 +0000 +++ b/kconfig/kconfig.mk Sun Jul 22 17:44:27 2007 +0000 @@ -82,7 +82,7 @@ # 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 @@ 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