Differences From
Artifact [8d3e37cc0b]:
85 85 cat $< >>$@
86 86 chmod +x $@
87 87
88 88 # raw bytecode without shebang header, must be run as `lua cortav.lc`
89 89 $(build)/$(executable).lc: sirsem.lua $(encoding-files) cortav.lua $(rendrs) $(extens) cli.lua | $(build)/
90 90 @echo ' » building with extensions $(extens-names)'
91 91 @echo ' » building with renderers $(rendrs-names)'
92 - $(call comp-lua,$^,$@)
92 + $(if $(debug),echo "require'sirsem'._debug=1" | $(call comp-lua,sirsem.lua - $(filter-out sirsem.lua,$^),$@),$(call comp-lua,$^,$@))
93 93
94 94 # true standalone binary, wraps bytecode file and (optionally) lua
95 95 $(build)/$(executable).bin: $(build)/$(executable).lc tool/makeshim.lua $(binds)
96 96 $(lua) tool/makeshim.lua $< "" $(binds-names) |\
97 97 $(CC) -s -o$@ -xc - -xnone $(binds) $(lua-standalone) $(lua-bindeps)
98 98
99 99 # loadable lua modules for binds, mainly useful for testing
................................................................................
104 104 $(build)/$(executable) $< -o $@ -m render:format html -y html:fossil-uv
105 105
106 106 .PHONY: syncdoc
107 107 syncdoc: $(build)/cortav.html
108 108 fossil uv add $< --as cortav.html
109 109 fossil uv sync --all
110 110
111 -# clean is written in overly cautious fashion to minimize damage,
112 -# just in case it ever gets invoked in a bad way (e.g. build=/)
111 +# clean and wipe are written in overly cautious fashion to minimize damage,
112 +# just in case they ever get invoked in a bad way (e.g. build=/)
113 113 .PHONY: clean
114 114 clean:
115 - rm -f $(build)/*.{html,lc,sh,txt,desktop} \
116 - $(build)/$(executable){,.bin} \
117 - $(build)/bind
115 + rm -f $(build)/*.{html,lc,sh,desktop} \
116 + $(build)/$(executable){,.bin}
117 + rm -r $(build)/bind
118 +# wipe also kills external datasheets
119 +.PHONY: wipe
120 +wipe: clean
121 + rm -f $(build)/*.txt
118 122 rmdir $(build)
119 123
120 124 $(build)/%.sh: desk/%.sh | $(build)/
121 125 echo >$@ "#!$(sh)"
122 126 echo >>$@ 'cortav_exec="$(bin-prefix)/$(executable)"'
123 127 echo >>$@ 'cortav_flags="$${ct_format_flags-$(default-format-flags)}"'
124 128 cat $< >> $@