Include the full version number in the directory paths installed.
Change the version string so that it does not break 'make', and so that it has no '/' (it would be a hell if installed directories would mirror the SVN branches... :-/ )
Do not use implicit rules for the Makefile.
Simplify and enc=hance the --local test to refuse (un)installing.
Double-quotes variables, they are based on user input.
Eye-candy in the 'compile' and install messages.
/trunk/configure | 26 14 12 0 ++++++++++---------
/trunk/Makefile.in | 83 45 38 0 +++++++++++++++++++++++++++++++++---------------------------
2 files changed, 59 insertions(+), 50 deletions(-)
1 # Makefile.in for building crosstool-NG
2 # This file serves as source for the ./configure operation
4 MAKEFLAGS += --no-print-directory --no-builtin-rules
8 # Check if Makefile is up to date:
10 @echo "$< did changed: you must re-run './configure'"
13 ###############################################################################
14 # Configuration variables
23 MAKE := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
25 ###############################################################################
28 build: build-bin build-lib build-man
30 install: build install-bin install-lib install-doc install-man
32 clean: clean-bin clean-lib clean-doc
35 @echo " RM 'Makefile'"
38 uninstall: uninstall-bin uninstall-lib uninstall-doc uninstall-man
40 ###############################################################################
43 #--------------------------------------
52 build-man: docs/ct-ng.1.gz
54 docs/ct-ng.1.gz: docs/ct-ng.1
60 @sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;' \
61 -e 's,@@CT_BINDIR@@,$(BINDIR),g;' \
62 -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;' \
63 -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;' \
64 -e 's,@@CT_MANDIR@@,$(MANDIR),g;' \
65 -e 's,@@CT_VERSION@@,$(VERSION),g;' \
66 -e 's,@@CT_DATE@@,$(DATE),g;' \
69 #--------------------------------------
79 @echo " RM 'docs/ct-ng.1'"
81 @echo " RM 'docs/ct-ng.1.gz'"
82 @rm -f docs/ct-ng.1.gz
84 #--------------------------------------
85 # Check for --local setup
87 # If using locally, don't install
89 @if [ "$(LOCAL)" = "1" ]; then \
90 echo "You're using local copy as runtime. You can't (un)install."; \
94 #--------------------------------------
99 install-bin: $(BINDIR)
100 @echo " INST 'ct-ng'"
101 @install -m 755 ct-ng "$(BINDIR)/ct-ng"
103 install-lib: uninstall-lib $(LIBDIR) install-lib-main install-lib-samples
105 install-lib-main: $(LIBDIR)
106 @for src_dir in arch config kconfig patches scripts tools; do \
107 echo " INST '$${src_dir}/'"; \
108 tar cf - --exclude=.svn $${src_dir} |(cd "$(LIBDIR)"; tar xf -); \
110 @rm -f "$(LIBDIR)/tools/addToolVersion.sh"
111 @echo " INST 'steps.mk'"
112 @install -m 644 steps.mk "$(LIBDIR)/steps.mk"
114 # Samples need a little love:
115 # - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
116 install-lib-samples: $(LIBDIR) install-lib-main
117 @echo " INST 'samples/'"
118 @tar cf - --exclude=.svn samples |(cd "$(LIBDIR)"; tar xf -)
119 @for samp_file in "$(LIBDIR)/samples/"*"/crosstool.config"; do \
120 sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
123 install-doc: $(DOCDIR)
124 @for doc_file in docs/CREDITS docs/overview.txt; do \
125 echo " INST '$${doc_file}'"; \
126 install -m 644 "$${doc_file}" "$(DOCDIR)"; \
129 install-man: $(MANDIR)
130 @echo " INST 'ct-ng.1.gz'"
131 @install -m 644 docs/ct-ng.1.gz "$(MANDIR)"
133 $(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
135 @install -m 755 -d "$@"
138 #--------------------------------------
141 uninstall-%: local-test
144 @rm -f "$(BINDIR)/ct-ng"
153 @rm -f "$(MANDIR)/ct-ng.1"{,.gz}