Browse Source

Move build stuff to mk.

Douglas William Thrift 12 years ago
parent
commit
bb13cae6af
5 changed files with 26 additions and 12 deletions
  1. 14 12
      GNUmakefile
  2. 0 0
      mk/bincmd.py
  3. 0 0
      mk/pkg.py
  4. 12 0
      mk/rm.py
  5. 0 0
      mk/touch.py

+ 14 - 12
GNUmakefile

@@ -4,14 +4,16 @@
 #
 # GNUmakefile
 
+python := python
+
 ifeq ($(OS),Windows_NT)
-    ATTRIB := attrib
-    RM_F := del /F /A
-    TOUCH := python touch.py
+    attrib := attrib
+    rm := $(python) mk/rm.py
+    touch := $(python) mk/touch.py
 else
-    ATTRIB := true
-    RM_F := rm -f
-    TOUCH := touch
+    attrib := true
+    rm := rm
+    touch := touch
 endif
 
 pyc := $(patsubst %.py,%.pyc,$(wildcard *.py */*.py))
@@ -21,17 +23,17 @@ pyc := $(patsubst %.py,%.pyc,$(wildcard *.py */*.py))
 all: dthome.wsgi
 
 dthome.wsgi: .requirements $(pyc) $(wildcard views/*.tpl)
-	$(TOUCH) $@
+	$(touch) $@
 
 requirements: .requirements
 
 .requirements: requirements.txt
-	python pkg.py install -r requirements.txt
-	$(TOUCH) $@
-	$(ATTRIB) +H $@
+	$(python) mk/pkg.py install -r requirements.txt
+	$(touch) $@
+	$(attrib) +H $@
 
 %.pyc: %.py
-	python -m py_compile $<
+	$(python) -m py_compile $<
 
 clean:
-	-$(RM_F) .requirements $(pyc)
+	-$(rm) -fv .requirements $(pyc)

+ 0 - 0
bincmd.py → mk/bincmd.py


+ 0 - 0
pkg.py → mk/pkg.py


+ 12 - 0
mk/rm.py

@@ -0,0 +1,12 @@
+#!/usr/bin/env python
+# DT Home
+#  Remove
+#
+# Douglas Thrift
+#
+# touch.py
+
+import bincmd
+
+if __name__ == '__main__':
+    bincmd.cmd('rm')

+ 0 - 0
touch.py → mk/touch.py