You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
671 B

4 years ago
  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