cortav  Diff

Differences From Artifact [d74d07de6f]:

To Artifact [9ea6c48a8b]:


    44     44   
    45     45   build = build
    46     46   executable = cortav
    47     47   default-format-flags = -m html:width 40em
    48     48   
    49     49   prefix = $(HOME)/.local
    50     50   bin-prefix = $(prefix)/bin
    51         -share-prefix = $(prefix)/share/$(executable)
    52     51   
    53     52   lua-standalone = $(if $(lua-lib-prefix),$(lua-lib-prefix)/liblua.a,-llua)
    54     53   lua-bindeps = -lm -ldl
    55     54   
    56     55   dbg-flags-luac = $(if $(debug),,-s)
    57     56   dbg-flags-cc = $(if $(debug),-g,-s)
    58     57   
................................................................................
    66     65   
    67     66   # by default, we fetch and parse information about encodings we
    68     67   # support so that cortav can do fancy things like format math
    69     68   # equations by character class (e.g. italicizing variables)
    70     69   # this is not necessary for parsing the format, and can be
    71     70   # disabled by blanking the encoding-data list when building
    72     71   # ($ make encoding-data=)
    73         -encoding-data  = ucstbls
    74         -encoding-files = $(patsubst %,$(build)/%.lc,$(encoding-data))
    75         -encoding-data-ucs = https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
           72  +encoding-data = 1
           73  +encoding-data-ucs = $(build)/unicode.txt
           74  +encoding-data-ucs-url = https://www.unicode.org/Public/UCD/latest/ucd/UnicodeData.txt
           75  +
           76  +encoding-files = $(if $(encoding-data),$(build)/ucstbls.lc,)
    76     77   
    77     78   # "standalone" bytecode file that can be run directly as a script
    78         -$(build)/$(executable): $(build)/$(executable).ct
           79  +$(build)/$(executable): $(build)/$(executable).lc
    79     80   	echo '#!$(lua)' > $@
    80     81   	cat $< >>$@
    81     82   	chmod +x $@
    82     83   
    83     84   # raw bytecode without shebang header, must be run as `lua cortav.lc`
    84     85   $(build)/$(executable).lc: sirsem.lua $(encoding-files) cortav.lua $(rendrs) $(extens) cli.lua | $(build)/
    85     86   	@echo ' » building with extensions $(extens-names)'
    86     87   	@echo ' » building with renderers $(rendrs-names)'
    87     88   	$(luac) $(dbg-flags-luac) -o $@ $^
    88     89   
    89     90   # true standalone binary, wraps bytecode file and (optionally) lua
    90         -$(build)/$(executable).bin: $(build)/$(executable).lc
    91         -	$(lua) tools/makeshim.lua $< |\
    92         -		$(CC) -o$@ -xc - -xnone $(lua-standalone) $(lua-bindeps)
           91  +$(build)/$(executable).bin: $(build)/$(executable).lc tool/makeshim.lua
           92  +	$(lua) tool/makeshim.lua $< |\
           93  +		$(CC) -s -o$@ -xc - -xnone $(lua-standalone) $(lua-bindeps)
    93     94   
    94     95   $(build)/cortav.html: cortav.ct $(build)/$(executable) | $(build)/
    95     96   	$(build)/$(executable) $< -o $@ -m render:format html -y html:fossil-uv
    96     97   
    97     98   .PHONY: syncdoc
    98     99   syncdoc: $(build)/cortav.html
    99    100   	fossil uv add $< --as cortav.html
................................................................................
   118    119   	cp $< $@
   119    120   	echo "Exec=$(bin-prefix)/cortav-view.sh" >>$@
   120    121   
   121    122   %/:
   122    123   	mkdir -p $@
   123    124   
   124    125   $(build)/unicode.txt: | $(build)/
   125         -	curl $(encoding-data-ucs) > $@
   126         -$(build)/ucstbls.lc: $(build)/unicode.txt tools/ucs.lua | $(build)/
   127         -	$(lua) tools/ucs.lua $< | $(luac) -o $@ -
          126  +	curl $(encoding-data-ucs-url) > $@
          127  +$(build)/ucstbls.lc: $(encoding-data-ucs) tool/ucs.lua | $(build)/
          128  +	$(lua) tool/ucs.lua $< | $(luac) -o $@ -
   128    129   
   129    130   .PHONY: install
   130    131   install: $(build)/cortav $(build)/cortav-view.sh $(build)/velartrill-cortav-view.desktop | $(bin-prefix)/
   131    132   	install $(build)/$(executable)  $(bin-prefix)
   132    133   	install $(build)/cortav-view.sh $(bin-prefix)
   133    134   	xdg-mime         install desk/velartrill-cortav.xml
   134    135   	xdg-desktop-menu install $(build)/velartrill-cortav-view.desktop