Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jun 17 16:24:23 2007 +0000 (2007-06-17)
changeset 176 59676cfb4ada
parent 172 7214624eb7b4
permissions -rw-r--r--
Rework the help system. For now, this is mostly a no-op (it only re-organise the help entries), but later, that may come in handy when we want ct-ng to be installable).
     1 # Makefile for crosstool-NG.
     2 # Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     3 
     4 # Don't print directory as we descend into them
     5 MAKEFLAGS += --no-print-directory
     6 
     7 export CT_TOP_DIR=$(shell pwd)
     8 
     9 # This is crosstool-ng version string
    10 export CT_VERSION=$(shell cat $(CT_TOP_DIR)/version)
    11 
    12 export CT_STOP=$(STOP)
    13 export CT_RESTART=$(RESTART)
    14 
    15 .PHONY: all
    16 all: build
    17 
    18 HOST_CC = gcc -funsigned-char
    19 
    20 # Help system
    21 help:: help-head help-config help-samples help-build help-distrib help-env help-tail
    22 
    23 help-head::
    24 	@echo  'Available make targets:'
    25 
    26 help-config::
    27 	@echo
    28 	@echo  'Configuration targets:'
    29 
    30 help-samples::
    31 	@echo
    32 	@echo  'Preconfigured targets:'
    33 
    34 help-build::
    35 	@echo
    36 	@echo  'Build targets:'
    37 
    38 help-distrib::
    39 	@echo
    40 	@echo  'Distribution targets:'
    41 
    42 help-env::
    43 	@echo
    44 	@echo  'Environement variables (see docs/overview.txt):'
    45 
    46 help-tail::
    47 	@echo
    48 	@echo  'Execute "make" or "make all" to build all targets marked with [*]'
    49 
    50 # End help system
    51 
    52 help-build::
    53 	@echo  '* build          - Build the toolchain'
    54 	@echo  '  clean          - Remove generated files'
    55 	@echo  '  distclean      - Remove generated files, configuration and build directories'
    56 
    57 include $(CT_TOP_DIR)/kconfig/Makefile
    58 include $(CT_TOP_DIR)/samples/Makefile
    59 include $(CT_TOP_DIR)/tools/Makefile
    60 include $(CT_TOP_DIR)/Makefile.steps
    61 
    62 help-distrib::
    63 	@echo  '  tarball        - Build a tarball of the configured toolchain'
    64 
    65 help-env::
    66 	@echo  '  STOP           - Stop the build just after this step'
    67 	@echo  '  RESTART        - Restart the build just before this step'
    68 
    69 .config:
    70 	@echo "You must run either one of \"make config\" or \"make menuconfig\" first"
    71 	@false
    72 
    73 # Actual build
    74 build: .config
    75 	@$(CT_TOP_DIR)/scripts/crosstool.sh
    76 
    77 .PHONY: tarball
    78 tarball:
    79 	@$(CT_TOP_DIR)/scripts/tarball.sh
    80 
    81 .PHONY: distclean
    82 distclean:: clean
    83 	@rm -f .config* ..config.tmp
    84 	@rm -f log.*
    85 	@[ ! -d "$(CT_TOP_DIR)/targets" ] || chmod -R u+w "$(CT_TOP_DIR)/targets"
    86 	@rm -rf "$(CT_TOP_DIR)/targets"