printj/bits/Makefile
SheetJS 35ed07bfb6 version bump 1.0.0
- added dist and minified source
- sharpened node check
2017-01-04 21:34:31 -05:00

25 lines
563 B
Makefile

ifndef OUTDIR
OUTDIR=$(PWD)/lib
endif
JSFILES=$(wildcard *.js)
LIBS=$(filter-out $(wildcard [0-9]*_*.js),$(wildcard *.js))
OUTLIBS=$(patsubst %,$(OUTDIR)/%,$(LIBS))
CPPFLAGS=-P -C -Wno-invalid-pp-token -fdollars-in-identifiers -nostdinc -Wundef -undef $(JSFLAGS)
.PHONY: lib
lib: init $(JSFILES)
for i in $(LIBS); do cpp $(CPPFLAGS) $$i | awk 'BEGIN{last=-3} NF>0 {last=NR} last >= NR-1' > $(OUTDIR)/$$i; done
.PHONY: init
init: 30_ctypes.js
30_ctypes.js: 30_ctypes.njs
node 30_ctypes.njs > 30_ctypes.js
.PHONY: clean
clean:
rm $(OUTLIBS) 30_ctypes.js