57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
|
lua-standalone = $(if $(lua-lib-prefix),$(lua-lib-prefix)/liblua.a,-llua)
lua-bindeps = -lm -ldl
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=)
................................................................................
cat $< >>$@
chmod +x $@
# raw bytecode without shebang header, must be run as `lua cortav.lc`
$(build)/$(executable).lc: sirsem.lua $(encoding-files) cortav.lua $(rendrs) $(extens) cli.lua | $(build)/
@echo ' » building with extensions $(extens-names)'
@echo ' » building with renderers $(rendrs-names)'
$(luac) $(dbg-flags-luac) -o $@ $^
# true standalone binary, wraps bytecode file and (optionally) lua
$(build)/$(executable).bin: $(build)/$(executable).lc tool/makeshim.lua $(binds)
$(lua) tool/makeshim.lua $< "" $(binds-names) |\
$(CC) -s -o$@ -xc - -xnone $(binds) $(lua-standalone) $(lua-bindeps)
# loadable lua modules for binds, mainly useful for testing
................................................................................
%/:
mkdir -p $@
$(build)/unicode.txt: | $(build)/
curl $(encoding-data-ucs-url) > $@
$(build)/ucstbls.lc: $(encoding-data-ucs) tool/ucs.lua | $(build)/
$(lua) tool/ucs.lua $< | $(luac) -o $@ -
.PHONY: install
install: $(build)/cortav $(build)/cortav-view.sh $(build)/velartrill-cortav-view.desktop | $(bin-prefix)/
install $(build)/$(executable) $(bin-prefix)
install $(build)/cortav-view.sh $(bin-prefix)
xdg-mime install desk/velartrill-cortav.xml
xdg-desktop-menu install $(build)/velartrill-cortav-view.desktop
|
|
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
..
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
...
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
lua-standalone = $(if $(lua-lib-prefix),$(lua-lib-prefix)/liblua.a,-llua)
lua-bindeps = -lm -ldl
ifneq ($(filter net,$(binds-names)),)
lua-bindeps += -lcurl
endif
ifneq (luac-broken,)
comp-lua = $(if $(debug),,env strip=1) $(lua) tool/luac.lua $1 $(if $2,>$2)
else
comp-lua = $(luac) $(if $(debug),,-s) -o $(if $2,$2,-) $1
endif
# 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=)
................................................................................
cat $< >>$@
chmod +x $@
# raw bytecode without shebang header, must be run as `lua cortav.lc`
$(build)/$(executable).lc: sirsem.lua $(encoding-files) cortav.lua $(rendrs) $(extens) cli.lua | $(build)/
@echo ' » building with extensions $(extens-names)'
@echo ' » building with renderers $(rendrs-names)'
$(call comp-lua,$^,$@)
# true standalone binary, wraps bytecode file and (optionally) lua
$(build)/$(executable).bin: $(build)/$(executable).lc tool/makeshim.lua $(binds)
$(lua) tool/makeshim.lua $< "" $(binds-names) |\
$(CC) -s -o$@ -xc - -xnone $(binds) $(lua-standalone) $(lua-bindeps)
# loadable lua modules for binds, mainly useful for testing
................................................................................
%/:
mkdir -p $@
$(build)/unicode.txt: | $(build)/
curl $(encoding-data-ucs-url) > $@
$(build)/ucstbls.lc: $(encoding-data-ucs) tool/ucs.lua | $(build)/
$(lua) tool/ucs.lua $< >$@
.PHONY: install
install: $(build)/cortav $(build)/cortav-view.sh $(build)/velartrill-cortav-view.desktop | $(bin-prefix)/
install $(build)/$(executable) $(bin-prefix)
install $(build)/cortav-view.sh $(bin-prefix)
xdg-mime install desk/velartrill-cortav.xml
xdg-desktop-menu install $(build)/velartrill-cortav-view.desktop
|