7430673d1df891c84623287197c051fb69ea117b
[protos/libecoli.git] / mk / ecoli-post.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright 2015, Olivier MATZ <zer0@droids-corp.org>
3
4 # ---- variables that must be defined:
5 #
6 #  ECOLI: path to ecoli root
7 #
8 # ---- variable that can be defined anywhere
9 #
10 #  CROSS: prefix of the toolchain
11 #  CP, LN, GAWK, GREP: coreutils tools
12 #  CC, CPP, AR, LD, OBJCOPY, OBJDUMP, STRIP: compilers/binutils
13 #
14 # ---- variable that can be defined by Makefile:
15 #
16 #  obj-y-$(path)
17 #  exe-y-$(path)
18 #  ar-y-$(path)
19 #  shlib-y-$(path)
20 #  copy-y-$(path)
21 #  slink-y-$(path)
22 #  objcopy-y-$(path)
23 #  subdir-y
24 #
25 #  CPPFLAGS, CFLAGS, LDFLAGS, LDLIBS: global flags
26 #  cflags-$(path), cppflags-$(path), ldflags-$(path), ldlibs-$(path): per
27 #    file flags
28 #  mkflags-$(path): flags for subdirectories
29 #
30 # ---- variables that can be defined on the command line:
31 #
32 #  EXTRA_CPPFLAGS, EXTRA_CFLAGS, EXTRA_LDFLAGS, EXTRA_LDLIBS: global
33 #    extra flags
34 #  extra-cflags-$(path), extra-cppflags-$(path): per object extra flags
35
36 ifeq ($(ECOLI),)
37 $(error ECOLI environment variable is not defined)
38 endif
39
40 # list of targets asked by user
41 all-targets :=
42 # list of files generated
43 all-clean-file :=
44
45 # usual internal variables:
46 #   out-$(file) = output path of a generated file
47 #   pre-$(file) = list of files needed to generate $(file)
48 #   all-type = list of targets for this type
49
50 include $(ECOLI)/mk/ecoli-obj-vars.mk
51 include $(ECOLI)/mk/ecoli-exe-vars.mk
52 include $(ECOLI)/mk/ecoli-ar-vars.mk
53 include $(ECOLI)/mk/ecoli-shlib-vars.mk
54 include $(ECOLI)/mk/ecoli-copy-vars.mk
55 include $(ECOLI)/mk/ecoli-slink-vars.mk
56 include $(ECOLI)/mk/ecoli-objcopy-vars.mk
57 include $(ECOLI)/mk/ecoli-subdir-vars.mk
58 # must stay at the end
59 include $(ECOLI)/mk/ecoli-clean-vars.mk
60
61 # dump the list of targets
62 ifeq ($(D),1)
63 $(call disp_list,------ all-targets,$(all-targets))
64 endif
65
66 # first rule (default)
67 .PHONY: _ecoli_all
68 _ecoli_all: $(all-targets)
69
70 # the includes below require second expansion
71 .SECONDEXPANSION:
72
73 include $(ECOLI)/mk/ecoli-obj-rules.mk
74 include $(ECOLI)/mk/ecoli-exe-rules.mk
75 include $(ECOLI)/mk/ecoli-ar-rules.mk
76 include $(ECOLI)/mk/ecoli-shlib-rules.mk
77 include $(ECOLI)/mk/ecoli-copy-rules.mk
78 include $(ECOLI)/mk/ecoli-slink-rules.mk
79 include $(ECOLI)/mk/ecoli-objcopy-rules.mk
80 include $(ECOLI)/mk/ecoli-subdir-rules.mk
81 include $(ECOLI)/mk/ecoli-clean-rules.mk
82
83 .PHONY: FORCE
84 FORCE: