.PHONY: all .SUFFIXES: .jspp .js PROJNAME=solardash VIRTUALENV ?= virtualenv-3.7 VRITUALENVARGS = CPP ?= cpp HOST ?= localhost RAINEAGLEDATAPREF ?= p/src/raineagle/fixtures/data FILES=$(PROJNAME)/__init__.py JSFILES = root/js/solardash.file.js root/js/solardash.https.js root/js/solardash.http.js THIRDPARTYJS = \ root/js/jquery.js \ root/js/highstock.js \ root/js/moment.min.js \ root/js/moment-timezone-with-data.min.js root/js/jquery.js: wget -O $@ "https://code.jquery.com/jquery-3.4.1.min.js" || (rm "$@"; false) root/js/moment.min.js: wget -O $@ "https://momentjs.com/downloads/moment.min.js" || (rm "$@"; false) root/js/moment-timezone-with-data.min.js: wget -O $@ "https://momentjs.com/downloads/moment-timezone-with-data-1970-2030.js" || (rm "$@"; false) root/js/highstock.js: Makefile wget -O - "https://code.highcharts.com/stock/8.0.0/highstock.js" | grep -v '^//# sourceMappingURL=' > $@ || (rm "$@"; false) root/js/highcharts.js: Makefile wget -O - "https://code.highcharts.com/stock/8.0.0/highcharts.js" | grep -v '^//# sourceMappingURL=' > $@ || (rm "$@"; false) root/js/solardash.http.js: root/js/solardash.https.js ln -s solardash.https.js $@ # manual deps JSBASE = root/js/solardash.base.js all: $(JSFILES) run: $(JSFILES) $(JSFILES): $(THIRDPARTYJS) $(JSBASE) root/js/solardash.file.js: fakedata.js fakedata.js: fakedata.py python $< > $@ || (rm $@; false) .jspp.js: # bsdmake uses $>, gmake uses $^ (echo '// DO NOT EDIT FILE!!!! THIS IS AUTOMATICALLY GENERATED!!!'; cat $^) > $@ || (rm "$@"; false) #cat $< $(THIRDPARTYJS) $(JSBASE) > $@ || (rm $@; false) keepupdate: find . -name '*.js' -o -name '*.jspp' | entr make all test: (ls $(FILES) $(JSFILES) | entr sh -c 'make all && python -m coverage run -m unittest $(PROJNAME) && coverage report --omit=p/\* -m -i') test-noentr: python -m coverage run -m unittest $(PROJNAME) && coverage report --omit=p/\* -m -i run: $(JSFILES) python -m aiohttp.web -H $(HOST) -P 38382 solardash:getapp $(RAINEAGLEDATAPREF) env: ($(VIRTUALENV) $(VIRTUALENVARGS) p && . ./p/bin/activate && pip install -r requirements.txt)