Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jun 17 12:57:46 2007 +0000 (2007-06-17)
changeset 171 dfc760ec0060
parent 168 45811aef4097
child 172 7214624eb7b4
permissions -rw-r--r--
Speak of regtest in "make help".
     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::
    21 	@echo  'Available make targets:'
    22 	@echo
    23 
    24 include $(CT_TOP_DIR)/kconfig/Makefile
    25 include $(CT_TOP_DIR)/samples/Makefile
    26 
    27 help::
    28 	@echo  'Build targets:'
    29 	@echo  '* build          - Build the toolchain'
    30 	@echo  '  regtest        - Regtest-build all samples'
    31 	@echo  '  clean          - Remove generated files'
    32 	@echo  '  distclean      - Remove generated files, configuration and build directories'
    33 
    34 include $(CT_TOP_DIR)/tools/Makefile
    35 include $(CT_TOP_DIR)/Makefile.steps
    36 
    37 help::
    38 	@echo  'Distribution targets:'
    39 	@echo  '  tarball        - Build a tarball of the configured toolchain'
    40 	@echo  ''
    41 	@echo  'Environement variables (see docs/overview.txt):'
    42 	@echo  '  STOP           - Stop the build just after this step'
    43 	@echo  '  RESTART        - Restart the build just before this step'
    44 	@echo  ''
    45 	@echo  'Execute "make" or "make all" to build all targets marked with [*]'
    46 
    47 .config:
    48 	@echo "You must run either one of \"make config\" or \"make menuconfig\" first"
    49 
    50 # Actual build
    51 build: .config
    52 	@$(CT_TOP_DIR)/scripts/crosstool.sh
    53 
    54 .PHONY: tarball
    55 tarball:
    56 	@$(CT_TOP_DIR)/scripts/tarball.sh
    57 
    58 .PHONY: distclean
    59 distclean:: clean
    60 	@rm -f .config* ..config.tmp
    61 	@rm -f log.*
    62 	@[ ! -d "$(CT_TOP_DIR)/targets" ] || chmod -R u+w "$(CT_TOP_DIR)/targets"
    63 	@rm -rf "$(CT_TOP_DIR)/targets"