ct-ng.in
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 15 09:09:04 2007 +0000 (2007-07-15)
changeset 261 4b8cba298bf3
parent 229 9c5809b7fd23
child 268 acf28f3d6ee1
permissions -rw-r--r--
Rename all Makefiles used by ct-ng into (something).mk, to avoid confusion.
     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  'See "man 1 ct-ng" for some help as well'
    63 
    64 # End help system
    65 
    66 help-build::
    67 	@echo  '  build          - Build the toolchain'
    68 
    69 help-clean::
    70 	@echo  '  clean          - Remove generated files'
    71 	@echo  '  distclean      - Remove generated files, configuration and build directories'
    72 
    73 include $(CT_LIB_DIR)/kconfig/kconfig.mk
    74 include $(CT_LIB_DIR)/samples/samples.mk
    75 include $(CT_LIB_DIR)/tools/tools.mk
    76 include $(CT_LIB_DIR)/steps.mk
    77 
    78 help-distrib::
    79 	@echo  '  tarball        - Build a tarball of the configured toolchain'
    80 
    81 help-env::
    82 	@echo  '  STOP           - Stop the build just after this step'
    83 	@echo  '  RESTART        - Restart the build just before this step'
    84 
    85 .config:
    86 	@echo  'You must run either one of "$(CT_NG) config" or "$(CT_NG) menuconfig" first'
    87 	@false
    88 
    89 # Actual build
    90 build:: .config
    91 	@$(CT_LIB_DIR)/scripts/crosstool.sh
    92 
    93 PHONY += tarball
    94 #tarball:
    95 #	@$(CT_LIB_DIR)/scripts/tarball.sh
    96 tarball:
    97 	@true
    98 
    99 PHONY += clean
   100 clean::
   101 	@rm -f $(CT_TOP_DIR)/.config.*
   102 
   103 PHONY += distclean
   104 distclean:: clean
   105 	@rm -f $(CT_TOP_DIR)/.config* $(CT_TOP_DIR)/..config.tmp
   106 	@rm -f $(CT_TOP_DIR)/log.*
   107 	@[ ! -d "$(CT_TOP_DIR)/targets" ] || chmod -R u+w "$(CT_TOP_DIR)/targets"
   108 	@rm -rf "$(CT_TOP_DIR)/targets"