32
33
34
35
36
37
38
39
40
41
42
43
44
45
..
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
# doesn't accept options like -l -x -o then you'll have to build
# the binary by hand, sorry. but if you want to contribute a build
# script to the repository, i'll happily take merge requests :)
lua != which lua
luac != which luac
sh != which sh
extens = $(wildcard ext/*.lua)
extens-names ?= $(basename $(notdir $(extens)))
rendrs = $(wildcard render/*.lua)
rendrs-names ?= $(basename $(notdir $(rendrs)))
binds = $(wildcard bind/*.c)
binds-names ?= $(basename $(notdir $(binds)))
................................................................................
ifneq ($(filter net,$(binds-names)),)
lua-bindeps += -lcurl
endif
dbg-flags-luac = $(if $(debug),,-s)
dbg-flags-cc = $(if $(debug),-g,-s)
# sterilize the operating theatre
export LUA_PATH=./?.lua;./?.lc
export LUA_PATH_5_3=./?.lc;./?.lua
export LUA_PATH_5_4=./?.lc;./?.lua
export LUA_INIT=
export LUA_INIT_5_3=
export LUA_INIT_5_4=
# by default, we fetch and parse information about encodings we
# support so that cortav can do fancy things like format math
# equations by character class (e.g. italicizing variables)
# this is not necessary for parsing the format, and can be
# disabled by blanking the encoding-data list when building
# ($ make encoding-data=)
................................................................................
.PHONY: syncdoc
syncdoc: $(build)/cortav.html
fossil uv add $< --as cortav.html
fossil uv sync --all
# clean is written in overly cautious fashion to minimize damage,
# just in case it ever gets invoked in a bad way
.PHONY: clean
clean:
rm -f $(build)/*.{html,lc,sh,txt,desktop} \
$(build)/$(executable){,.bin}
rmdir $(build)
$(build)/%.sh: desk/%.sh | $(build)/
echo >$@ "#!$(sh)"
echo >>$@ 'cortav_exec="$(bin-prefix)/$(executable)"'
echo >>$@ 'cortav_flags="$${ct_format_flags-$(default-format-flags)}"'
cat $< >> $@
|
>
>
>
<
<
<
<
<
<
<
|
|
>
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
..
60
61
62
63
64
65
66
67
68
69
70
71
72
73
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# doesn't accept options like -l -x -o then you'll have to build
# the binary by hand, sorry. but if you want to contribute a build
# script to the repository, i'll happily take merge requests :)
lua != which lua
luac != which luac
sh != which sh
#sterilize the operating theatre
lua += -E
extens = $(wildcard ext/*.lua)
extens-names ?= $(basename $(notdir $(extens)))
rendrs = $(wildcard render/*.lua)
rendrs-names ?= $(basename $(notdir $(rendrs)))
binds = $(wildcard bind/*.c)
binds-names ?= $(basename $(notdir $(binds)))
................................................................................
ifneq ($(filter net,$(binds-names)),)
lua-bindeps += -lcurl
endif
dbg-flags-luac = $(if $(debug),,-s)
dbg-flags-cc = $(if $(debug),-g,-s)
# by default, we fetch and parse information about encodings we
# support so that cortav can do fancy things like format math
# equations by character class (e.g. italicizing variables)
# this is not necessary for parsing the format, and can be
# disabled by blanking the encoding-data list when building
# ($ make encoding-data=)
................................................................................
.PHONY: syncdoc
syncdoc: $(build)/cortav.html
fossil uv add $< --as cortav.html
fossil uv sync --all
# clean is written in overly cautious fashion to minimize damage,
# just in case it ever gets invoked in a bad way (e.g. build=/)
.PHONY: clean
clean:
rm -f $(build)/*.{html,lc,sh,txt,desktop} \
$(build)/$(executable){,.bin} \
$(build)/bind
rmdir $(build)
$(build)/%.sh: desk/%.sh | $(build)/
echo >$@ "#!$(sh)"
echo >>$@ 'cortav_exec="$(bin-prefix)/$(executable)"'
echo >>$@ 'cortav_flags="$${ct_format_flags-$(default-format-flags)}"'
cat $< >> $@
|