cortav  Diff

Differences From Artifact [97fc0b1491]:

To Artifact [a11f003028]:


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