Fix running without installing.

Update README.
Point help to the man page.
This commit is contained in:
Yann E. MORIN" 2007-07-01 21:21:11 +00:00
parent e9e6759672
commit 1bb07c805c
4 changed files with 49 additions and 23 deletions

View File

@ -8,10 +8,11 @@ all: build
VERSION:= @@VERSION@@ VERSION:= @@VERSION@@
BINDIR := @@BINDIR@@ BINDIR := @@BINDIR@@
LIBDIR := @@LIBDIR@@/ct-ng-$(VERSION) LIBDIR := @@LIBDIR@@
DOCDIR := @@DOCDIR@@/ct-ng-$(VERSION) DOCDIR := @@DOCDIR@@
MANDIR := @@MANDIR@@/man1 MANDIR := @@MANDIR@@
DATE := @@DATE@@ DATE := @@DATE@@
LOCAL := @@LOCAL@@
MAKE := $(shell which make || type -p make || echo /usr/bin/make) MAKE := $(shell which make || type -p make || echo /usr/bin/make)
############################################################################### ###############################################################################
@ -65,12 +66,19 @@ clean-doc:
#-------------------------------------- #--------------------------------------
# Install rules # Install rules
install-bin: $(BINDIR) # If using localy, don't install
install-local:
@if [ "$(LOCAL)" = "1" ]; then \
echo "You're using local copy as runtime. You can't install."; \
false; \
fi
install-bin: install-local $(BINDIR)
@install -m 755 ct-ng $(BINDIR)/ct-ng @install -m 755 ct-ng $(BINDIR)/ct-ng
install-lib: $(LIBDIR) install-lib-main install-lib-samples install-lib: install-local $(LIBDIR) install-lib-main install-lib-samples
install-lib-main: $(LIBDIR) install-lib-main: install-local $(LIBDIR)
@for src_dir in config kconfig patches scripts tools; do \ @for src_dir in config kconfig patches scripts tools; do \
tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \ tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
done done
@ -80,13 +88,13 @@ install-lib-main: $(LIBDIR)
# Samples need a little love: # Samples need a little love:
# - change every occurence of CT_TOP_DIR to CT_LIB_DIR # - change every occurence of CT_TOP_DIR to CT_LIB_DIR
install-lib-samples: $(LIBDIR) install-lib-main install-lib-samples: install-local $(LIBDIR) install-lib-main
@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -) @tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do \ @for samp_file in $(LIBDIR)/samples/*/crosstool.config; do \
sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \ sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
done done
install-doc: $(DOCDIR) $(MANDIR) install-doc: install-local $(DOCDIR) $(MANDIR)
@for doc_file in LICENSES licenses.d COPYING CREDITS docs/overview.txt; do \ @for doc_file in LICENSES licenses.d COPYING CREDITS docs/overview.txt; do \
install -m 644 docs/overview.txt $(DOCDIR); \ install -m 644 docs/overview.txt $(DOCDIR); \
done done

10
README
View File

@ -1,13 +1,15 @@
This is the README for crosstool-NG This is the README for crosstool-NG
To get you started, just enter: To get you started, just enter:
make help ./configure --help
You can find a (terse and WIP) documentation in docs/. You can find a (terse and WIP) documentation in docs/overview.txt.
You can also point your browser to You can also point your browser to
http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
If you need to send a bug report or a patch, please mail: If you need to send a bug report or a patch, please send a mail with subject
prefixed with "[CT_NG]" to:
yann.morin.1998 (at) anciens.enib.fr yann.morin.1998 (at) anciens.enib.fr
with subject prefixed with "[CT_NG]"
Aloha!

37
configure vendored
View File

@ -4,15 +4,12 @@ VERSION=$(cat version)
DATE=$(date +%Y%m%d) DATE=$(date +%Y%m%d)
PREFIX_DEFAULT=/usr/local PREFIX_DEFAULT=/usr/local
BINDIR_DEFAULT="${PREFIX}/bin"
LIBDIR_DEFAULT="${PREFIX}/lib"
DOCDIR_DEFAULT="${PREFIX}/share/doc"
MANDIR_DEFAULT="${PREFIX}/share/man"
BINDIR_set= BINDIR_set=
LIBDIR_set= LIBDIR_set=
DOCDIR_set= DOCDIR_set=
MANDIR_set= MANDIR_set=
LOCAL_set=
get_optval(){ get_optval(){
local ret local ret
@ -34,9 +31,9 @@ set_prefix() {
PREFIX=$(get_optval "$1" "$2") PREFIX=$(get_optval "$1" "$2")
ret=$? ret=$?
[ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin" [ -z "${BINDIR_set}" ] && BINDIR="${PREFIX}/bin"
[ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib" [ -z "${LIBDIR_set}" ] && LIBDIR="${PREFIX}/lib/ct-ng-${VERSION}"
[ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc" [ -z "${DOCDIR_set}" ] && DOCDIR="${PREFIX}/share/doc/ct-ng-${VERSION}"
[ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man" [ -z "${MANDIR_set}" ] && MANDIR="${PREFIX}/share/man/man1"
return ${ret} return ${ret}
} }
@ -82,8 +79,8 @@ Defaults for the options are specified in brackets.
Configuration: Configuration:
-h, --help display this help and exit -h, --help display this help and exit
--prefix=PREFIX install architecture-independent files in PREFIX --prefix=PREFIX install files in PREFIX [${PREFIX_DEFAULT}]
[${PREFIX_DEFAULT}] --local don't install, and use current directory
By default, \`make install' will install all the files in By default, \`make install' will install all the files in
\`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify \`${PREFIX_DEFAULT}/bin', \`${PREFIX_DEFAULT}/lib' etc. You can specify
@ -107,12 +104,20 @@ while [ $# -ne 0 ]; do
--libdir*) set_libdir "$1" "$2" && shift || shift 2;; --libdir*) set_libdir "$1" "$2" && shift || shift 2;;
--docdir*) set_docdir "$1" "$2" && shift || shift 2;; --docdir*) set_docdir "$1" "$2" && shift || shift 2;;
--mandir*) set_mandir "$1" "$2" && shift || shift 2;; --mandir*) set_mandir "$1" "$2" && shift || shift 2;;
--local) LOCAL_set=1; shift;;
--help|-h) do_help; exit 0;; --help|-h) do_help; exit 0;;
*) do_help; exit 1;; *) do_help; exit 1;;
esac esac
done done
[ -z "${PREFIX}" ] && set_prefix --prefix "${PREFIX_DEFAULT}" [ -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;" \ sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
-e "s,@@LIBDIR@@,${LIBDIR},g;" \ -e "s,@@LIBDIR@@,${LIBDIR},g;" \
@ -120,4 +125,14 @@ sed -r -e "s,@@BINDIR@@,${BINDIR},g;" \
-e "s,@@MANDIR@@,${MANDIR},g;" \ -e "s,@@MANDIR@@,${MANDIR},g;" \
-e "s,@@VERSION@@,${VERSION},g;" \ -e "s,@@VERSION@@,${VERSION},g;" \
-e "s,@@DATE@@,${DATE},g;" \ -e "s,@@DATE@@,${DATE},g;" \
Makefile.in >Makefile -e "s,@@LOCAL@@,${LOCAL_set},g;" \
Makefile.in >Makefile
cat <<__EOF__
ct-ng configured as follows:
PREFIX="${PREFIX}"
BINDIR="${BINDIR}"
LIBDIR="${LIBDIR}"
DOCDIR="${DOCDIR}"
MANDIR="${MANDIR}"
__EOF__

View File

@ -55,6 +55,7 @@ help-tail::
@echo @echo
@echo 'Execute "$(CT_NG) config" or "$(CT_NG) menuconfig" to configure ct-ng' @echo 'Execute "$(CT_NG) config" or "$(CT_NG) menuconfig" to configure ct-ng'
@echo 'Execute "$(CT_NG)" or "$(CT_NG) all" to build all targets marked with [*]' @echo 'Execute "$(CT_NG)" or "$(CT_NG) all" to build all targets marked with [*]'
@echo 'See "man 1 ct-ng" for some help as well'
# End help system # End help system