@@ -1,10 +1,34 @@ +# [ʞ] makefile +# ~ lexi hale +# 🄯 AGPLv3 +# ? this script performs the tasks necessary to produce a mostly +# standalone cortav executable from the source files in the +# repository. it assumes the presence of the following tools +# in $SHELL or in $PATH: +# +# * which * cat +# * mkdir * echo +# * install * lua +# * luac * sh +# +# if any are not present, the build will fail, although a missing +# `which` can be worked around by specifying the paths to lua, luac, +# and `sh` directly +# +# eventually you will be able to set a "standalone" variable to +# create a truly standalone binary, by embedding the binary in a +# C program and statically linking it to lua. + 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))) + build = build executable = cortav default-format-flags = -m html:width 40em @@ -21,10 +45,11 @@ encoding-data = ucstbls encoding-files = $(patsubst %,$(build)/%.lc,$(encoding-data)) encoding-data-ucs = https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt -$(build)/$(executable): sirsem.lua $(encoding-files) cortav.lua $(extens) cli.lua | $(build)/ +$(build)/$(executable): sirsem.lua $(encoding-files) cortav.lua $(rendrs) $(extens) cli.lua | $(build)/ @echo ' » building with extensions $(extens-names)' + @echo ' » building with renderers $(rendrs-names)' echo '#!$(lua)' > $@ luac -o - $^ >> $@ chmod +x $@ @@ -55,9 +80,9 @@ mkdir -p $@ $(build)/unicode.txt: | $(build)/ curl $(encoding-data-ucs) > $@ -$(build)/ucstbls.lc: $(build)/unicode.txt | $(build)/ +$(build)/ucstbls.lc: $(build)/unicode.txt tools/ucs.lua | $(build)/ $(lua) tools/ucs.lua $< | $(luac) -o $@ - .PHONY: install install: $(build)/cortav $(build)/cortav-view.sh $(build)/velartrill-cortav-view.desktop | $(bin-prefix)/