Switch to good old make to reduce redundancies in build
This commit is contained in:
parent
2c17758987
commit
413a8b5b81
4 changed files with 77 additions and 19 deletions
62
Makefile
Normal file
62
Makefile
Normal file
|
@ -0,0 +1,62 @@
|
|||
GENEXT = src/helpers/pkglock_to_externals.litcoffee
|
||||
GENDOC = doc/gendoc.litcoffee
|
||||
DOCFILES = $(shell coffee $(GENDOC) -list)
|
||||
COFFILES = $(wildcard src/*.litcoffee)
|
||||
JSFILES = $(patsubst src/%.litcoffee,site/%.js,$(COFFILES))
|
||||
HTMLSRC = $(wildcard src/*.html)
|
||||
HTMLSITE = $(patsubst src/%,site/%,$(HTMLSRC))
|
||||
BLDTARGS = $(JSFILES) site/externals.js site/doc/dyna3.html $(HTMLSITE) site/node_modules
|
||||
TESTCOFF = $(wildcard coffeetest/*.coffee)
|
||||
TESTJS = $(patsubst coffeetest/%.coffee,__tests__/%.js,$(TESTCOFF))
|
||||
|
||||
build: $(BLDTARGS)
|
||||
|
||||
site/externals.js: $(GENEXT) package.json package-lock.json
|
||||
mkdir -p site
|
||||
coffee $(GENEXT) > $@
|
||||
|
||||
site/%.js: src/%.litcoffee
|
||||
coffee -o $@ -c -m $<
|
||||
|
||||
docbuild/extlist.md: $(GENEXT) package.json package-lock.json
|
||||
mkdir -p docbuild
|
||||
coffee $(GENEXT) --doc > $@
|
||||
|
||||
site/doc/dyna3.md: $(DOCFILES)
|
||||
mkdir -p site/doc
|
||||
coffee $(GENDOC) > $@
|
||||
|
||||
site/doc/dyna3.html: site/doc/dyna3.md
|
||||
pandoc -s --metadata title='dyna3' --toc $< > $@
|
||||
|
||||
site/%.html: src/%.html
|
||||
mkdir -p site
|
||||
cp $< $@
|
||||
|
||||
site/node_modules: node_modules package.json package-lock.json
|
||||
rm -rf tmpproj
|
||||
mkdir tmpproj
|
||||
mkdir -p site
|
||||
cp package.json package-lock.json tmpproj
|
||||
cd tmpproj && npm install --production
|
||||
cp -r tmpproj/node_modules site
|
||||
|
||||
dyna3.zip: $(BLDTARGS)
|
||||
zip -r $@ site
|
||||
|
||||
__tests__/%.js: coffeetest/%.coffee
|
||||
coffee -o $@ -c -m $<
|
||||
|
||||
$(BLDTARGS) $(TESTJS): Makefile
|
||||
|
||||
doc: site/doc/dyna3.md
|
||||
|
||||
dist: dyna3.zip
|
||||
|
||||
pretest: $(BLDTARGS) $(TESTJS)
|
||||
|
||||
test: $(BLDTARGS) $(TESTJS)
|
||||
npm test
|
||||
|
||||
clean:
|
||||
rm -rf site docbuild tmpproj __tests__ coverage dyna3.zip
|
Loading…
Add table
Add a link
Reference in a new issue