summaryrefslogtreecommitdiffstats
path: root/kBuild/doc/Makefile.kmk
blob: 17730b16e878a4f888c602ea42b03227361ca991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
DEPTH = ../..
include ../header.kmk

TXTFILES = \
	QuickReference-kmk.txt \
	QuickReference-kBuild.txt

define genrule
all: $(name).html
clean::
	kmk_rm -f $(name).html
$(name).html: $(name).txt
	LC_ALL=C rst2html.py --no-generator $$< $$@
$(name).o: $(name).html
.PHONY: $(name).o
endef

$(foreach name, $(basename $(TXTFILES)), $(eval $(genrule)))


#
# For generating the basis for the target properties table.
#
my_tp.1 = BLDPROGS PROGRAMS
my_tp.2 = LIBRARIES
my_tp.3 = IMPORT_LIBS DLLS
my_tp.4 = DLLS
my_tp.5 = PROGRAMS
my_tp.6 = SYSMODS
my_tp.7 = MISCBINS
my_tp.8 = INSTALLS
my_tp.9 = FETCHES
my_tp.a = OTHERS
my_tp = 1 2 3 4 5 6 7 8 9 a
tpc := $(translate $(my_tp),$(SP))

define def_target_prop_rule
target-properties::
	@$$(PRINTF) '|%-2s| %-18s| %-6s|%$(expr 79-33)s|\n' "$(kind)" "``$(prop)``" "$(my_tmp_which)" ""
	@$$(ECHO) '+--+-------------------+-------+----------------------------------------------+'
endef
define def_target_prop_doit
my_tmp_which := $(foreach x,$(my_tp),$(if $(intersects \
                     $(prop),\
                     $(foreach nm,$(my_tp.$(x)),$(foreach suff,SINGLE DEFERRED ACCUMULATE_R ACCUMULATE_L,$(PROPS_$(nm)_$(suff)))))\
                ,$(x),))
my_tmp_which := $(translate $(my_tmp_which),$(SP))
$(for local i = 1, $i < 10, local i := $(expr $i + 1),$(for local l = $(expr 10 - $i + 1), $l > 3, local l := $(expr $l - 1), \
	$(eval my_tmp_which:=$(subst $(substr $(tpc), $i, $l),$i-$(substr $(tpc),$(expr $i + $l - 1),1),$(my_tmp_which)))\
) )
$(eval $(def_target_prop_rule))
endef
kind := S
$(foreach prop,$(sort $(PROPS_SINGLE)),$(evalcall def_target_prop_doit))
kind := D
$(foreach prop,$(sort $(PROPS_DEFERRED)),$(evalcall def_target_prop_doit))
kind := Ar
$(foreach prop,$(sort $(PROPS_ACCUMULATE_R)),$(evalcall def_target_prop_doit))
kind := Al
$(foreach prop,$(sort $(PROPS_ACCUMULATE_L)),$(evalcall def_target_prop_doit))
#kind := To
#$(foreach prop,$(sort $(PROPS_TOOLS_ONLY)),$(evalcall def_target_prop_doit))