Use the paths found by ./configure in the ct-ng.in makefile script and its fragments.
/trunk/kconfig/kconfig.mk | 2 1 1 0 +-
/trunk/samples/samples.mk | 18 9 9 0 +++++++++---------
/trunk/config/config.mk | 10 5 5 0 +++++-----
/trunk/ct-ng.in | 22 13 9 0 +++++++++++++---------
4 files changed, 28 insertions(+), 24 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 ###############################################################################
9 # Configuration variables
19 # Paths found by ./configure
27 ###############################################################################
30 # Check if Makefile is up to date:
32 @echo "$< did changed: you must re-run './configure'"
35 # If installing with DESTDIR, check it's an absolute path
36 ifneq ($(strip $(DESTDIR)),)
37 ifneq ($(DESTDIR),$(abspath /$(DESTDIR)))
38 $(error DESTDIR is not an absolute PATH: '$(DESTDIR)')
42 ###############################################################################
45 TARGETS := bin lib doc man
47 build: $(patsubst %,build-%,$(TARGETS))
49 install: build real-install
51 clean: $(patsubst %,clean-%,$(TARGETS))
54 @echo " RM 'Makefile'"
57 uninstall: real-uninstall
59 ###############################################################################
62 #--------------------------------------
71 build-man: docs/ct-ng.1.gz
73 docs/ct-ng.1.gz: docs/ct-ng.1
79 @$(sed) -r -e 's,@@CT_BINDIR@@,$(BINDIR),g;' \
80 -e 's,@@CT_LIBDIR@@,$(LIBDIR),g;' \
81 -e 's,@@CT_DOCDIR@@,$(DOCDIR),g;' \
82 -e 's,@@CT_MANDIR@@,$(MANDIR),g;' \
83 -e 's,@@CT_VERSION@@,$(VERSION),g;' \
84 -e 's,@@CT_DATE@@,$(DATE),g;' \
85 -e 's,@@CT_make@@,$(make),g;' \
88 # We create a script fragment that is parseable from inside a Makefile,
89 # but also from inside a shell script, hence the reason why we don't
90 # use := to set varaibles, although that will incur a (very small)
91 # penalty from the Makefile that includes it (due to re-evaluation at
95 @(echo "export install=$(install)"; \
96 echo "export bash=$(bash)"; \
97 echo "export grep=$(grep)"; \
98 echo "export make=$(make)"; \
99 echo "export awk=$(awk)"; \
100 echo "export sed=$(sed)"; \
103 #--------------------------------------
111 @echo " RM 'paths.mk'"
117 @echo " RM 'docs/ct-ng.1'"
119 @echo " RM 'docs/ct-ng.1.gz'"
120 @rm -f docs/ct-ng.1.gz
122 #--------------------------------------
123 # Check for --local setup
125 ifeq ($(strip $(LOCAL)),1)
128 @echo " CHMOD 'ct-ng'"
136 #--------------------------------------
139 real-install: $(patsubst %,install-%,$(TARGETS))
141 install-bin: $(DESTDIR)$(BINDIR)
142 @echo " INST 'ct-ng'"
143 @$(install) -m 755 ct-ng "$(DESTDIR)$(BINDIR)/ct-ng"
145 # If one is hacking crosstool-NG, the patch set might change between any two
146 # installations of the same VERSION, thus the patches must be removed prior
147 # to being installed. It is simpler to remove the whole lib/ directory, as it
148 # is the goal of the install-lib rule to install the lib/ directory...
149 install-lib: uninstall-lib $(DESTDIR)$(LIBDIR) install-lib-main install-lib-samples
151 install-lib-main: $(DESTDIR)$(LIBDIR)
152 @for src_dir in config kconfig patches scripts; do \
153 echo " INST '$${src_dir}/'"; \
154 tar cf - --exclude=.svn $${src_dir} |(cd "$(DESTDIR)$(LIBDIR)"; tar xf -); \
156 @rm -f "$(DESTDIR)$(LIBDIR)/scripts/addToolVersion.sh"
157 @echo " INST 'steps.mk'"
158 @$(install) -m 644 steps.mk "$(DESTDIR)$(LIBDIR)/steps.mk"
159 @echo " INST 'paths.mk'"
160 @$(install) -m 644 paths.mk "$(DESTDIR)$(LIBDIR)/paths.mk"
162 # Samples need a little love:
163 # - change every occurrence of CT_TOP_DIR to CT_LIB_DIR
164 install-lib-samples: $(DESTDIR)$(LIBDIR) install-lib-main
165 @echo " INST 'samples/'"
166 @tar cf - --exclude=.svn samples |(cd "$(DESTDIR)$(LIBDIR)"; tar xf -)
167 @for samp_file in "$(DESTDIR)$(LIBDIR)/samples/"*"/crosstool.config"; do \
168 $(sed) -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
169 $(sed) -r -i -e 's,^(CT_WORK_DIR)=.*,\1="\$${CT_TOP_DIR}/targets",;' $${samp_file}; \
172 install-doc: $(DESTDIR)$(DOCDIR)
173 @for doc_file in docs/CREDITS docs/overview.txt; do \
174 echo " INST '$${doc_file}'"; \
175 $(install) -m 644 "$${doc_file}" "$(DESTDIR)$(DOCDIR)"; \
178 install-man: $(DESTDIR)$(MANDIR)
179 @echo " INST 'ct-ng.1.gz'"
180 @$(install) -m 644 docs/ct-ng.1.gz "$(DESTDIR)$(MANDIR)"
182 $(sort $(DESTDIR)$(BINDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(DOCDIR) $(DESTDIR)$(MANDIR)):
184 @$(install) -m 755 -d "$@"
187 #--------------------------------------
190 real-uninstall: $(patsubst %,uninstall-%,$(TARGETS))
193 @echo " RM '$(DESTDIR)$(BINDIR)/ct-ng'"
194 @rm -f "$(DESTDIR)$(BINDIR)/ct-ng"
197 @echo " RMDIR '$(DESTDIR)$(LIBDIR)/'"
198 @rm -rf "$(DESTDIR)$(LIBDIR)"
201 @echo " RMDIR '$(DESTDIR)$(DOCDIR)/'"
202 @rm -rf "$(DESTDIR)$(DOCDIR)"
205 @echo " RM '$(DESTDIR)$(MANDIR)/ct-ng.1.gz'"
206 @rm -f "$(DESTDIR)$(MANDIR)/ct-ng.1"{,.gz}