2007-07-02 19:40:54 +00:00
|
|
|
# Makefile.in for building crosstool-NG
|
2007-07-01 19:04:20 +00:00
|
|
|
# This file serves as source for the ./configure operation
|
|
|
|
|
|
|
|
all: build
|
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Configuration variables
|
|
|
|
|
|
|
|
VERSION:= @@VERSION@@
|
|
|
|
BINDIR := @@BINDIR@@
|
2007-07-01 21:21:11 +00:00
|
|
|
LIBDIR := @@LIBDIR@@
|
|
|
|
DOCDIR := @@DOCDIR@@
|
|
|
|
MANDIR := @@MANDIR@@
|
2007-07-01 19:04:20 +00:00
|
|
|
DATE := @@DATE@@
|
2007-07-22 17:44:27 +00:00
|
|
|
LOCAL := @@LOCAL@@
|
|
|
|
MAKE := $(shell which $(MAKE) || type -p $(MAKE) || echo /usr/bin/make)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Global make rules
|
|
|
|
|
2007-07-30 21:23:53 +00:00
|
|
|
build: build-bin build-lib build-man
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-28 11:57:42 +00:00
|
|
|
install: install-local-test build install-bin install-lib install-doc install-man
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
clean: clean-bin clean-lib clean-doc
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
@rm -f Makefile
|
|
|
|
|
2007-07-28 11:57:42 +00:00
|
|
|
uninstall: install-local-test uninstall-bin uninstall-lib uninstall-doc uninstall-man
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# Specific make rules
|
|
|
|
|
|
|
|
#--------------------------------------
|
|
|
|
# Build rules
|
|
|
|
|
|
|
|
build-bin: ct-ng
|
2007-07-01 20:56:25 +00:00
|
|
|
@chmod a+x ct-ng
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
build-lib:
|
|
|
|
|
2007-07-30 21:23:53 +00:00
|
|
|
build-man: docs/ct-ng.1.gz
|
|
|
|
|
|
|
|
docs/ct-ng.1.gz: docs/ct-ng.1
|
|
|
|
@echo " GZIP $@"
|
2007-08-07 17:08:13 +00:00
|
|
|
@gzip -f9 $<
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
%: %.in
|
2007-07-14 10:19:01 +00:00
|
|
|
@echo " SED $@"
|
2007-07-01 19:04:20 +00:00
|
|
|
@sed -r -e 's,@@CT_MAKE@@,$(MAKE),g;' \
|
|
|
|
-e 's,@@CT_BINDIR@@,$(BINDIR),g;' \
|
|
|
|
-e 's,@@CT_LIBDIR@@,$(LIBDIR),g;' \
|
|
|
|
-e 's,@@CT_DOCDIR@@,$(DOCDIR),g;' \
|
|
|
|
-e 's,@@CT_MANDIR@@,$(MANDIR),g;' \
|
|
|
|
-e 's,@@CT_VERSION@@,$(VERSION),g;' \
|
|
|
|
-e 's,@@CT_DATE@@,$(DATE),g;' \
|
|
|
|
$@.in >$@
|
|
|
|
|
|
|
|
#--------------------------------------
|
|
|
|
# Clean rules
|
|
|
|
|
|
|
|
clean-bin:
|
|
|
|
@rm -f ct-ng
|
|
|
|
|
|
|
|
clean-lib:
|
|
|
|
|
|
|
|
clean-doc:
|
2007-08-07 17:08:13 +00:00
|
|
|
@rm -f docs/ct-ng.1.gz
|
2007-07-01 19:04:20 +00:00
|
|
|
|
|
|
|
#--------------------------------------
|
|
|
|
# Install rules
|
|
|
|
|
2007-07-22 17:44:27 +00:00
|
|
|
# If using localy, don't install
|
|
|
|
install-local-test:
|
2007-07-28 11:57:42 +00:00
|
|
|
@if [ "$(LOCAL)" = "1" ]; then \
|
|
|
|
echo "You're using local copy as runtime. You can't (un)install."; \
|
|
|
|
false; \
|
2007-07-22 17:44:27 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
install-bin: install-local-test $(BINDIR)
|
2007-07-14 10:19:01 +00:00
|
|
|
@echo " INST ct-ng"
|
2007-07-01 19:04:20 +00:00
|
|
|
@install -m 755 ct-ng $(BINDIR)/ct-ng
|
|
|
|
|
2007-07-22 17:44:27 +00:00
|
|
|
install-lib: install-local-test $(LIBDIR) install-lib-main install-lib-samples
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-22 17:44:27 +00:00
|
|
|
install-lib-main: install-local-test $(LIBDIR)
|
2007-07-01 19:04:20 +00:00
|
|
|
@for src_dir in config kconfig patches scripts tools; do \
|
2007-07-14 10:19:01 +00:00
|
|
|
echo " INST $${src_dir}/"; \
|
2007-07-01 19:04:20 +00:00
|
|
|
tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
|
|
|
|
done
|
2007-07-08 22:28:47 +00:00
|
|
|
@rm -f $(LIBDIR)/tools/addToolVersion.sh
|
2007-07-15 09:09:04 +00:00
|
|
|
@for src_file in steps.mk version; do \
|
2007-07-14 10:19:01 +00:00
|
|
|
echo " INST $${src_file}"; \
|
2007-07-01 19:04:20 +00:00
|
|
|
install -m 644 $${src_file} $(LIBDIR)/$${src_file}; \
|
|
|
|
done
|
|
|
|
|
|
|
|
# Samples need a little love:
|
|
|
|
# - change every occurence of CT_TOP_DIR to CT_LIB_DIR
|
2007-07-22 17:44:27 +00:00
|
|
|
install-lib-samples: install-local-test $(LIBDIR) install-lib-main
|
2007-07-14 10:19:01 +00:00
|
|
|
@echo " INST samples/"
|
2007-07-01 19:04:20 +00:00
|
|
|
@tar cf - --exclude=.svn samples |(cd $(LIBDIR); tar xf -)
|
2007-07-02 17:49:21 +00:00
|
|
|
@for samp_file in $(LIBDIR)/samples/*/crosstool.config; do \
|
2007-07-01 19:04:20 +00:00
|
|
|
sed -r -i -e 's,\$$\{CT_TOP_DIR\},\$$\{CT_LIB_DIR\},g;' $${samp_file}; \
|
|
|
|
done
|
|
|
|
|
2007-07-22 17:44:27 +00:00
|
|
|
install-doc: install-local-test $(DOCDIR)
|
2007-07-22 21:29:42 +00:00
|
|
|
@for doc_file in docs/CREDITS docs/overview.txt; do \
|
|
|
|
echo " INST $${doc_file}"; \
|
|
|
|
install -m 644 "$${doc_file}" $(DOCDIR); \
|
2007-07-01 19:04:20 +00:00
|
|
|
done
|
2007-07-14 10:19:01 +00:00
|
|
|
|
2007-07-22 17:44:27 +00:00
|
|
|
install-man: install-local-test $(MANDIR)
|
2007-07-30 21:23:53 +00:00
|
|
|
@echo " INST ct-ng.1.gz"
|
|
|
|
@install -m 644 docs/ct-ng.1.gz $(MANDIR)
|
2007-07-01 19:04:20 +00:00
|
|
|
|
2007-07-01 20:56:25 +00:00
|
|
|
$(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
|
2007-07-14 10:19:01 +00:00
|
|
|
@echo " MKDIR $@"
|
2007-07-01 19:04:20 +00:00
|
|
|
@install -m 755 -d $@
|
|
|
|
|
|
|
|
|
|
|
|
#--------------------------------------
|
|
|
|
# Uninstall rules
|
|
|
|
|
2007-07-28 11:57:42 +00:00
|
|
|
uninstall-bin: install-local-test
|
2007-07-01 19:04:20 +00:00
|
|
|
@rm -f $(BINDIR)/ct-ng
|
|
|
|
|
2007-07-28 11:57:42 +00:00
|
|
|
uninstall-lib: install-local-test
|
2007-07-01 19:04:20 +00:00
|
|
|
@rm -rf $(LIBDIR)
|
|
|
|
|
2007-07-28 11:57:42 +00:00
|
|
|
uninstall-doc: install-local-test
|
2007-07-01 19:04:20 +00:00
|
|
|
@rm -rf $(DOCDIR)
|
2007-07-28 20:45:24 +00:00
|
|
|
|
|
|
|
uninstall-man: install-local-test
|
2007-07-30 21:10:22 +00:00
|
|
|
@rm -f $(MANDIR)/ct-ng.1{,.gz}
|