ct-ng.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jan 25 22:59:55 2009 +0000 (2009-01-25)
changeset 1154 0f15f05af399
parent 1143 eee9e8de51e3
child 1155 21e86e18f344
permissions -rw-r--r--
Makefile.in: remove generated paths.mk during clean

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