ct-ng.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Thu Apr 02 20:44:39 2009 +0000 (2009-04-02)
branch1.3
changeset 1285 4150b61102e4
parent 1015 d9a132dcd329
child 1101 29ebc048d33f
permissions -rw-r--r--
Bump version to 1.3.3.

/branches/1.3/.version | 2 1 1 0 +-
1 file changed, 1 insertion(+), 1 deletion(-)
     1 #!@@CT_MAKE@@ -rf
     2 # Makefile for crosstool-NG.
     3 # Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     4 
     5 # Don't print directory as we descend into them
     6 # Don't use built-in rules, we know what we're doing
     7 MAKEFLAGS += --no-print-directory --no-builtin-rules
     8 
     9 # Some distributions (eg. Ubuntu) thought it wise to point /bin/sh to
    10 # a truly POSIX-conforming shell, ash in this case. This is not so good
    11 # as we, smart (haha!) developers (as smart we ourselves think we are),
    12 # got used to bashisms, and are enclined to easiness... So force use of
    13 # bash. (Note: this is ugly, but ./configure checks for it).
    14 export SHELL=/bin/bash
    15 
    16 # This is where ct-ng is.
    17 # Don't bother to change it other than with a new ./configure!
    18 CT_NG:=@@CT_BINDIR@@/ct-ng
    19 
    20 export CT_TOP_DIR:=$(shell pwd)
    21 export CT_LIB_DIR:=@@CT_LIBDIR@@
    22 export CT_DOC_DIR:=@@CT_DOCDIR@@
    23 
    24 # This is crosstool-NG version string
    25 export CT_VERSION:=@@CT_VERSION@@
    26 
    27 # Don't go parallel
    28 .NOTPARALLEL:
    29 
    30 export CT_STOP:=$(STOP)
    31 export CT_RESTART:=$(RESTART)
    32 
    33 SILENT=@
    34 ECHO=echo
    35 ifeq ($(strip $(origin V)),command line)
    36   ifeq ($(strip $(V)),0)
    37     SILENT=@
    38     ECHO=:
    39   else
    40     ifeq ($(strip $(V)),1)
    41       SILENT=
    42       ECHO=:
    43     else
    44       ifeq ($(strip $(V)),2)
    45         SILENT=
    46         ECHO=echo
    47       endif # V == 2
    48     endif # V== 1
    49   endif # V == 0
    50 endif # origin V
    51 export V SILENT ECHO
    52 
    53 .FORCE:
    54 .PHONY: $(PHONY)
    55 PHONY += all
    56 all: help
    57 
    58 # Help system
    59 help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail
    60 
    61 help-head:: version
    62 	@echo  'See below for a list of available actions, listed by category:'
    63 
    64 help-config::
    65 	@echo
    66 	@echo  'Configuration actions:'
    67 
    68 help-samples::
    69 	@echo
    70 	@echo  'Preconfigured toolchains (#: force number of // jobs):'
    71 
    72 help-build::
    73 	@echo
    74 	@echo  'Build actions (#: force number of // jobs):'
    75 
    76 help-clean::
    77 	@echo
    78 	@echo  'Clean actions:'
    79 
    80 help-distrib::
    81 	@echo
    82 	@echo  'Distribution actions:'
    83 
    84 help-env::
    85 	@echo
    86 	@echo  'Environement variables (see @@CT_DOCDIR@@/overview.txt):'
    87 
    88 help-tail::
    89 	@echo
    90 	@echo  'Use action "config" or "menuconfig" to configure crosstool-NG'
    91 	@echo  'Use action "build" to build your toolchain'
    92 	@echo  'Use action "version" to see the version'
    93 	@echo  'See "man 1 ct-ng" for some help as well'
    94 
    95 help-build::
    96 	@echo  '  build[.#]          - Build the currently configured toolchain'
    97 
    98 help-clean::
    99 	@echo  '  clean              - Remove generated files'
   100 	@echo  '  distclean          - Remove generated files, configuration and build directories'
   101 
   102 include $(CT_LIB_DIR)/config/config.mk
   103 include $(CT_LIB_DIR)/kconfig/kconfig.mk
   104 include $(CT_LIB_DIR)/steps.mk
   105 include $(CT_LIB_DIR)/samples/samples.mk
   106 include $(CT_LIB_DIR)/tools/tools.mk
   107 
   108 help-distrib::
   109 	@echo  '  tarball            - Build a tarball of the configured toolchain'
   110 
   111 help-env::
   112 
   113 # End help system
   114 
   115 .config:
   116 	@echo ' There is no existing .config file!'
   117 	@false
   118 
   119 # Actual build
   120 build: .config
   121 	$(SILENT)$(CT_LIB_DIR)/scripts/crosstool.sh
   122 
   123 build.%:
   124 	$(SILENT)$(MAKE) -rf $(CT_NG) $(shell echo "$(@)" |sed -r -e 's|^([^.]+)\.([[:digit:]]+)$$|\1 CT_JOBS=\2|;')
   125 
   126 PHONY += tarball
   127 #tarball:
   128 #	@$(CT_LIB_DIR)/scripts/tarball.sh
   129 tarball:
   130 	@echo 'Tarball creation disabled for now... Sorry.'
   131 	@true
   132 
   133 PHONY += version
   134 version:
   135 	@echo 'This is crosstool-NG version $(CT_VERSION)'
   136 	@echo
   137 	@echo 'Copyright (C) 2008  Yann E. MORIN <yann.morin.1998@anciens.enib.fr>'
   138 	@echo 'This is free software; see the source for copying conditions.'
   139 	@echo 'There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A'
   140 	@echo 'PARTICULAR PURPOSE.'
   141 	@echo
   142 
   143 PHONY += clean
   144 clean::
   145 	@$(ECHO) "  CLEAN log"
   146 	$(SILENT)rm -f log.* .config.* ..config*
   147 
   148 PHONY += distclean
   149 distclean:: clean
   150 	@$(ECHO) "  CLEAN .config"
   151 	$(SILENT)rm -f .config .config.* ..config*
   152 	@$(ECHO) "  CLEAN targets"
   153 	$(SILENT)chmod -R u+w targets >/dev/null 2>&1 || true
   154 	$(SILENT)rm -rf targets