ct-ng.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sat Jul 21 20:31:26 2007 +0000 (2007-07-21)
changeset 281 7039139a912a
parent 268 acf28f3d6ee1
child 284 23ae4aebb94c
permissions -rw-r--r--
Vampirise two more patches against uClibc-0.9.29 from buildroot.
     1 #!@@CT_MAKE@@ -f
     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 MAKEFLAGS += --no-print-directory
     7 
     8 # Remember the name of the Makefile
     9 CT_MAKEFILE := $(lastword $(MAKEFILE_LIST))
    10 CT_NG := $(shell echo '$(CT_MAKEFILE)' |sed -r -e 's,($(subst :,|,$(PATH)))/,,;')
    11 
    12 export CT_TOP_DIR:=$(shell pwd)
    13 export CT_LIB_DIR:=@@CT_LIBDIR@@
    14 export CT_DOC_DIR:=@@CT_DOCDIR@@
    15 
    16 # This is crosstool-NG version string
    17 export CT_VERSION=$(shell cat $(CT_LIB_DIR)/version)
    18 
    19 export CT_STOP=$(STOP)
    20 export CT_RESTART=$(RESTART)
    21 
    22 .PHONY: $(PHONY)
    23 PHONY += all
    24 all: help
    25 
    26 HOST_CC = gcc -funsigned-char
    27 
    28 # Help system
    29 help:: help-head help-config help-samples help-build help-clean help-distrib help-env help-tail
    30 
    31 help-head::
    32 	@echo  'Available actions:'
    33 
    34 help-config::
    35 	@echo
    36 	@echo  'Configuration actions:'
    37 
    38 help-samples::
    39 	@echo
    40 	@echo  'Preconfigured toolchains:'
    41 
    42 help-build::
    43 	@echo
    44 	@echo  'Build actions:'
    45 
    46 help-clean::
    47 	@echo
    48 	@echo  'Clean actions:'
    49 
    50 help-distrib::
    51 	@echo
    52 	@echo  'Distribution actions:'
    53 
    54 help-env::
    55 	@echo
    56 	@echo  'Environement variables (see @@CT_DOCDIR@@/overview.txt):'
    57 
    58 help-tail::
    59 	@echo
    60 	@echo  'Execute "$(CT_NG) config" or "$(CT_NG) menuconfig" to configure crosstool-NG'
    61 	@echo  'Execute "$(CT_NG) build" to build your toolchain'
    62 	@echo  'Execute "$(CT_NG) version" to see the version'
    63 	@echo  'See "man 1 ct-ng" for some help as well'
    64 
    65 # End help system
    66 
    67 help-build::
    68 	@echo  '  build          - Build the toolchain'
    69 
    70 help-clean::
    71 	@echo  '  clean          - Remove generated files'
    72 	@echo  '  distclean      - Remove generated files, configuration and build directories'
    73 
    74 include $(CT_LIB_DIR)/kconfig/kconfig.mk
    75 include $(CT_LIB_DIR)/samples/samples.mk
    76 include $(CT_LIB_DIR)/tools/tools.mk
    77 include $(CT_LIB_DIR)/steps.mk
    78 
    79 help-distrib::
    80 	@echo  '  tarball        - Build a tarball of the configured toolchain'
    81 
    82 help-env::
    83 	@echo  '  STOP           - Stop the build just after this step'
    84 	@echo  '  RESTART        - Restart the build just before this step'
    85 
    86 .config:
    87 	@echo  'You must run either one of "$(CT_NG) config" or "$(CT_NG) menuconfig" first'
    88 	@false
    89 
    90 # Actual build
    91 build:: .config
    92 	@$(CT_LIB_DIR)/scripts/crosstool.sh
    93 
    94 PHONY += tarball
    95 #tarball:
    96 #	@$(CT_LIB_DIR)/scripts/tarball.sh
    97 tarball:
    98 	@echo 'Tarbal creation disabled for now... Sorry.'
    99 	@true
   100 
   101 PHONY += version
   102 version:
   103 	@echo 'This is crosstool-NG version $(CT_VERSION)'
   104 
   105 PHONY += clean
   106 clean::
   107 	@rm -f $(CT_TOP_DIR)/.config.*
   108 
   109 PHONY += distclean
   110 distclean:: clean
   111 	@rm -f $(CT_TOP_DIR)/.config* $(CT_TOP_DIR)/..config.tmp
   112 	@rm -f $(CT_TOP_DIR)/log.*
   113 	@[ ! -d "$(CT_TOP_DIR)/targets" ] || chmod -R u+w "$(CT_TOP_DIR)/targets"
   114 	@rm -rf "$(CT_TOP_DIR)/targets"