embox
1#
2# Bootstrap script.
3#
4# It, first, ensures that all cached scripts are up-to-date, regenerating them
5# if necessary. Next, it searches the source tree for my- and config-files,
6# parses and links them together, and saves the resulting object graph.
7#
8# When everything is ready, the script spawns a sub-make for 'mk/build.mk',
9# preloading all the generated scripts and exporting the following variables:
10#
11# load_mk_files
12# List of files, where the cached scripts (Make functions) have been saved.
13#
14# load_mybuild_files
15# Lists the following three files (see below):
16# '$(myfiles_model_mk) $(configfiles_model_mk) $(build_model_mk)'
17#
18# myfiles_model_mk
19# As the name proposes, it is a file where all my-files linked together
20# are stored.
21#
22# configfiles_model_mk
23# Config-files linked together and with my-files.
24#
25# build_model_mk
26# Build model inferred from the two models described above.
27#
28# Date: Apr 3, 2012
29# Author: Eldar Abusalimov
30#
31
32.DELETE_ON_ERROR:
33.SECONDEXPANSION:
34
35# The order of these inclusions is important.
36include mk/load-mk.inc.mk
37include mk/load-mybuild.inc.mk
38
39.PHONY : $(MAKECMDGOALS)
40$(MAKECMDGOALS) : $(load_mk_files) $(load_mybuild_files)
41@$(MAKE) -f mk/build.mk MAKEFILES='$^' $@
42
43%/. :
44@$(MKDIR) $*
45