Solar Array and home energy dashboard.
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.
 
 
 
 
 

44 lines
1.3 KiB

  1. .PHONY: all
  2. .SUFFIXES: .jspp .js
  3. PROJNAME=solardash
  4. VIRTUALENV ?= virtualenv-3.7
  5. VRITUALENVARGS =
  6. FILES=$(PROJNAME)/__init__.py
  7. JSFILES = root/js/solardash.file.js root/js/solardash.https.js
  8. THIRDPARTYJS = root/js/jquery.js root/js/highstock.js
  9. root/js/jquery.js:
  10. wget -O $@ "https://code.jquery.com/jquery-3.4.1.min.js"
  11. root/js/highstock.js: Makefile
  12. wget -O - "https://code.highcharts.com/stock/8.0.0/highstock.js" | grep -v '^//# sourceMappingURL=' > $@ || (rm "$@"; false)
  13. root/js/highcharts.js: Makefile
  14. wget -O - "https://code.highcharts.com/stock/8.0.0/highcharts.js" | grep -v '^//# sourceMappingURL=' > $@ || (rm "$@"; false)
  15. # manual deps
  16. root/js/solardash.base.js: $(THIRDPARTYJS)
  17. root/js/solardash.file.js: root/js/solardash.base.js
  18. root/js/solardash.https.js: root/js/solardash.base.js
  19. all: $(JSFILES)
  20. .jspp.js:
  21. cpp -Wno-invalid-pp-token -E $< | sed -e '/^#/d' > $@ || (rm "$@"; false)
  22. keepupdate:
  23. find . -name '*.js' -o -name '*.jspp' | entr make all
  24. test:
  25. (ls $(FILES) $(JSFILES) | entr sh -c 'make all && python -m coverage run -m unittest $(PROJNAME) && coverage report --omit=p/\* -m -i')
  26. test-noentr:
  27. python -m coverage run -m unittest $(PROJNAME) && coverage report --omit=p/\* -m -i
  28. env:
  29. ($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt)