Makefile 671 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. .PHONY: all serve clean
  2. COFFEE:=./node_modules/.bin/coffee
  3. #### General
  4. all: build
  5. build: src/*coffee
  6. @$(COFFEE) -v > /dev/null
  7. $(COFFEE) -o lib/ -c src/*.coffee
  8. clean:
  9. rm -f lib/*.js
  10. #### Testing
  11. test_server: build
  12. node tests/test_server/server.js
  13. serve:
  14. @if [ -e .pidfile.pid ]; then \
  15. kill `cat .pidfile.pid`; \
  16. rm .pidfile.pid; \
  17. fi
  18. @while [ 1 ]; do \
  19. make build; \
  20. echo " [*] Running http server"; \
  21. make test_server & \
  22. SRVPID=$$!; \
  23. echo $$SRVPID > .pidfile.pid; \
  24. echo " [*] Server pid: $$SRVPID"; \
  25. inotifywait -r -q -e modify .; \
  26. kill `cat .pidfile.pid`; \
  27. rm -f .pidfile.pid; \
  28. sleep 0.1; \
  29. done