Makefile
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun May 20 13:48:26 2007 +0000 (2007-05-20)
changeset 112 ea15433daba0
parent 96 aa1a9fbd6eb8
child 121 82e69d88119b
permissions -rw-r--r--
Ah! I finally have a progress bar that doesn't stall the build!
- pipe size in Linux is only 8*512=4096 bytes
- pipe size is not setable
- when the feeding process spits out data faster than the eating
process can read it, then the feeding process stalls after 4KiB
of data sent to the pipe
- for us, the progress bar would spawn a sub-shell every line,
and the sub-shell would in turn spawn a 'date' command.
Which was sloooww as hell, and would cause some kind of a
starvation: the pipe was full most of the time, and the
feeding process was stalled all this time.

Now, we use internal variables and a little hack based onan offset
to determine the elapsed time. Much faster this way, but still
CPU-intensive.
     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 .PHONY: all
    13 all: build
    14 
    15 HOST_CC = gcc -funsigned-char
    16 
    17 help::
    18 	@echo  'Available make targets:'
    19 	@echo
    20 
    21 include $(CT_TOP_DIR)/kconfig/Makefile
    22 include $(CT_TOP_DIR)/samples/Makefile
    23 
    24 help::
    25 	@echo  'Build targets:'
    26 	@echo  '* build          - Build the toolchain'
    27 	@echo  '  tarball        - Build a tarball of the configured toolchain'
    28 	@echo  '  clean          - Remove generated files'
    29 	@echo  '  distclean      - Remove generated files, configuration and build directories'
    30 
    31 include $(CT_TOP_DIR)/tools/Makefile
    32 
    33 help::
    34 	@echo  'Execute "make" or "make all" to build all targets marked with [*]'
    35 
    36 .config: $(CONFIG_FILES) $(CT_TOP_DIR)/config/debug.in
    37 	@make oldconfig
    38 
    39 # Actual build
    40 build: .config
    41 	@$(CT_TOP_DIR)/scripts/crosstool.sh
    42 
    43 .PHONY: tarball
    44 tarball:
    45 	@$(CT_TOP_DIR)/scripts/tarball.sh
    46 
    47 .PHONY: distclean
    48 distclean:: clean
    49 	@rm -f .config* ..config.tmp
    50 	@rm -rf "$(CT_TOP_DIR)/targets"