printj/bits/Makefile
2016-09-19 02:33:23 -04:00

25 lines
519 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 | uniq > $(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