GNUmakefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # DT Home
  2. #
  3. # Douglas Thrift
  4. #
  5. # GNUmakefile
  6. # Copyright 2012 Douglas Thrift
  7. #
  8. # Licensed under the Apache License, Version 2.0 (the "License");
  9. # you may not use this file except in compliance with the License.
  10. # You may obtain a copy of the License at
  11. #
  12. # http://www.apache.org/licenses/LICENSE-2.0
  13. #
  14. # Unless required by applicable law or agreed to in writing, software
  15. # distributed under the License is distributed on an "AS IS" BASIS,
  16. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. # See the License for the specific language governing permissions and
  18. # limitations under the License.
  19. python := python
  20. ifeq ($(OS),Windows_NT)
  21. attrib := attrib
  22. rm := $(python) mk/rm.py
  23. touch := $(python) mk/touch.py
  24. else
  25. attrib := true
  26. rm := rm
  27. touch := touch
  28. endif
  29. pyc := $(patsubst %.py,%.pyc,$(wildcard *.py */*.py))
  30. .PHONY: all requirements clean
  31. all: dthome.wsgi
  32. dthome.wsgi: .requirements $(pyc) $(wildcard views/*.tpl)
  33. $(touch) $@
  34. requirements: .requirements
  35. .requirements: requirements.txt
  36. $(python) mk/pkg.py install -r requirements.txt
  37. $(touch) $@
  38. $(attrib) +H $@
  39. %.pyc: %.py
  40. $(python) -m py_compile $<
  41. clean:
  42. -$(rm) -fv .requirements $(pyc)