mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2024-12-27 00:11:05 +00:00
123 lines
3.1 KiB
Makefile
123 lines
3.1 KiB
Makefile
# Makefile.in for building crosstool-NG
|
|
# This file serves as source for the ./configure operation
|
|
|
|
all: build
|
|
|
|
###############################################################################
|
|
# Configuration variables
|
|
|
|
VERSION:= @@VERSION@@
|
|
BINDIR := @@BINDIR@@
|
|
LIBDIR := @@LIBDIR@@
|
|
DOCDIR := @@DOCDIR@@
|
|
MANDIR := @@MANDIR@@
|
|
DATE := @@DATE@@
|
|
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
|
|
|
|
clean: clean-bin clean-lib clean-doc
|
|
|
|
distclean: clean
|
|
@rm -f Makefile
|
|
|
|
uninstall: uninstall-bin uninstall-lib uninstall-doc
|
|
|
|
###############################################################################
|
|
# Specific make rules
|
|
|
|
#--------------------------------------
|
|
# Build rules
|
|
|
|
build-bin: ct-ng
|
|
@chmod a+x ct-ng
|
|
|
|
build-lib:
|
|
|
|
build-doc: docs/ct-ng.1
|
|
|
|
%: %.in
|
|
@echo " SED $@"
|
|
@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:
|
|
@rm -f docs/ct-ng.1
|
|
|
|
#--------------------------------------
|
|
# Install rules
|
|
|
|
install-bin: $(BINDIR)
|
|
@echo " INST ct-ng"
|
|
@install -m 755 ct-ng $(BINDIR)/ct-ng
|
|
|
|
install-lib: $(LIBDIR) install-lib-main install-lib-samples
|
|
|
|
install-lib-main: $(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 -); \
|
|
done
|
|
@rm -f $(LIBDIR)/tools/addToolVersion.sh
|
|
@for src_file in steps.mk version; do \
|
|
echo " INST $${src_file}"; \
|
|
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
|
|
install-lib-samples: $(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)
|
|
@for doc_file in CREDITS docs/overview.txt; do \
|
|
echo " INST $${doc_file}"; \
|
|
install -m 644 "$${doc_file}" $(DOCDIR); \
|
|
done
|
|
|
|
install-man: $(MANDIR)
|
|
@echo " INST ct-ng.1"
|
|
@install -m 644 docs/ct-ng.1 $(MANDIR)
|
|
|
|
$(BINDIR) $(LIBDIR) $(DOCDIR) $(MANDIR)::
|
|
@echo " MKDIR $@"
|
|
@install -m 755 -d $@
|
|
|
|
|
|
#--------------------------------------
|
|
# Uninstall rules
|
|
|
|
uninstall-bin:
|
|
@rm -f $(BINDIR)/ct-ng
|
|
@rm -f $(BINDIR)/ct-ng.extract-config
|
|
|
|
uninstall-lib:
|
|
@rm -rf $(LIBDIR)
|
|
|
|
uninstall-doc:
|
|
@rm -rf $(DOCDIR)
|
|
@rm -f $(MANDIR)/ct-ng.1
|