2018-03-28 06:07:51 +03:00
|
|
|
NPM_PREFIX=$(realpath .)/node_modules
|
2018-03-28 05:28:49 +03:00
|
|
|
PATH:=${NPM_PREFIX}/.bin:${PATH}
|
2018-03-28 22:14:45 +03:00
|
|
|
SHELL:=env PATH=${PATH} /bin/sh
|
2018-03-28 00:58:12 +03:00
|
|
|
|
2018-03-28 06:03:45 +03:00
|
|
|
.PHONY: test
|
|
|
|
test: elm-stuff tests/elm-stuff node_modules
|
|
|
|
elm-test
|
2018-03-28 06:00:47 +03:00
|
|
|
|
|
|
|
.PHONY: diff
|
2018-03-30 17:10:39 +03:00
|
|
|
diff: node_modules elm-stuff
|
|
|
|
if (elm-package diff | tee /dev/stderr | grep -q MAJOR); then echo "MAJOR changes are not allowed!"; exit 1; fi
|
2018-03-28 00:58:12 +03:00
|
|
|
|
2018-03-28 06:00:47 +03:00
|
|
|
.PHONY: format
|
|
|
|
format: node_modules
|
|
|
|
elm-format --validate src tests styleguide-app
|
|
|
|
|
|
|
|
.PHONY: clean
|
2018-03-28 00:58:12 +03:00
|
|
|
clean:
|
2018-06-11 21:08:49 +03:00
|
|
|
rm -rf node_modules styleguide-app/elm.js styleguide-app/javascript.js $(shell find . -type d -name 'elm-stuff')
|
2018-03-28 00:58:12 +03:00
|
|
|
|
2018-05-17 16:59:35 +03:00
|
|
|
documentation.json: node_modules
|
|
|
|
elm-make --docs $@
|
|
|
|
|
2018-06-11 21:08:49 +03:00
|
|
|
styleguide-app/javascript.js: lib/index.js
|
|
|
|
npx browserify --entry lib/index.js --outfile styleguide-app/javascript.js
|
|
|
|
|
|
|
|
styleguide-app/elm.js: styleguide-app/javascript.js styleguide-app/elm-stuff $(shell find src styleguide-app -type f -name '*.elm')
|
2018-03-28 06:14:24 +03:00
|
|
|
cd styleguide-app; elm-make Main.elm --output=$(@F)
|
2018-03-28 01:00:46 +03:00
|
|
|
|
2018-03-28 00:58:12 +03:00
|
|
|
# plumbing
|
|
|
|
|
|
|
|
node_modules: package.json
|
|
|
|
npm install
|
|
|
|
touch -m $@
|
|
|
|
|
2018-03-28 05:37:47 +03:00
|
|
|
.NOTPARALLEL: elm-stuff
|
2018-03-28 06:00:36 +03:00
|
|
|
elm-stuff: elm-package.json node_modules
|
2018-03-28 05:28:49 +03:00
|
|
|
elm-package install --yes
|
2018-03-28 00:58:12 +03:00
|
|
|
touch -m $@
|
|
|
|
|
2018-03-28 06:00:36 +03:00
|
|
|
.NOTPARALLEL: %/elm-stuff
|
|
|
|
%/elm-stuff: %/elm-package.json node_modules
|
|
|
|
cd $(@D); elm-package install --yes
|
2018-03-28 01:00:46 +03:00
|
|
|
touch -m $@
|
2018-03-28 06:03:45 +03:00
|
|
|
|
|
|
|
# special targets for travis, but anyone can use them, really.
|
|
|
|
|
|
|
|
.PHONY: setup
|
|
|
|
setup: node_modules elm-stuff tests/elm-stuff styleguide-app/elm-stuff
|
|
|
|
|
|
|
|
.PHONY: ci
|
2018-05-17 16:59:35 +03:00
|
|
|
ci: test format documentation.json diff styleguide-app/elm.js
|