steps.mk
author "Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Mon Oct 27 18:42:26 2008 +0000 (2008-10-27)
changeset 1001 c8ac48ba1411
parent 940 f0f9ba3f98f2
child 1010 45316336f45f
permissions -rw-r--r--
Enhance the make fragments:
- comment the different parts
- re-order the code so that it is homogeneous amogst fragments
- eye-candy in some existing comments

/trunk/tools/tools.mk | 17 15 2 0 +++++++++++++++--
/trunk/steps.mk | 38 26 12 0 ++++++++++++++++++++++++++------------
/trunk/samples/samples.mk | 41 28 13 0 ++++++++++++++++++++++++++++-------------
/trunk/config/config.mk | 2 1 1 0 +-
4 files changed, 70 insertions(+), 28 deletions(-)
yann@136
     1
# Makefile for each steps
yann@136
     2
# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
yann@136
     3
yann@1001
     4
# ----------------------------------------------------------
yann@1001
     5
# This is the steps help entry
yann@1001
     6
yann@1001
     7
help-build::
yann@1001
     8
	@echo  '  list-steps         - List all build steps'
yann@1001
     9
yann@1001
    10
# ----------------------------------------------------------
yann@1001
    11
# The steps list
yann@1001
    12
yann@1001
    13
# Please keep the last line with a '\' and keep the folowing empy line:
yann@1001
    14
# it helps when diffing and merging.
yann@461
    15
CT_STEPS := libc_check_config   \
yann@461
    16
            kernel_headers      \
yann@466
    17
            gmp                 \
yann@466
    18
            mpfr                \
yann@461
    19
            binutils            \
yann@461
    20
            cc_core_pass_1      \
yann@461
    21
            libc_headers        \
yann@461
    22
            libc_start_files    \
yann@461
    23
            cc_core_pass_2      \
yann@461
    24
            libc                \
yann@461
    25
            cc                  \
yann@461
    26
            libc_finish         \
yann@461
    27
            binutils_target     \
yann@602
    28
            gmp_target          \
yann@602
    29
            mpfr_target         \
yann@461
    30
            tools               \
yann@461
    31
            debug               \
yann@461
    32
yann@1001
    33
# Make the list available to sub-processes (scripts/crosstool.sh needs it)
yann@461
    34
export CT_STEPS
yann@181
    35
yann@1001
    36
# Print the steps list
yann@1001
    37
PHONY += list-steps
yann@1001
    38
list-steps:
yann@1001
    39
	@echo  'Available build steps, in order:'
yann@1001
    40
	@for step in $(CT_STEPS); do    \
yann@1001
    41
	     echo "  - $${step}";       \
yann@1001
    42
	 done
yann@1001
    43
	@echo  'Use "<step>" as action to execute only that step.'
yann@1001
    44
	@echo  'Use "+<step>" as action to execute up to that step.'
yann@1001
    45
	@echo  'Use "<step>+" as action to execute from that step onward.'
yann@1001
    46
yann@1001
    47
# ----------------------------------------------------------
yann@1001
    48
# This part deals with executing steps
yann@1001
    49
yann@181
    50
$(CT_STEPS):
yann@940
    51
	$(SILENT)$(MAKE) -rf $(CT_NG) RESTART=$@ STOP=$@ build
yann@136
    52
yann@304
    53
$(patsubst %,+%,$(CT_STEPS)):
yann@940
    54
	$(SILENT)$(MAKE) -rf $(CT_NG) STOP=$(patsubst +%,%,$@) build
yann@136
    55
yann@304
    56
$(patsubst %,%+,$(CT_STEPS)):
yann@940
    57
	$(SILENT)$(MAKE) -rf $(CT_NG) RESTART=$(patsubst %+,%,$@) build