packager: allow overrideing package info from cli
[pharext/pharext] / Makefile
index 4ce9ceade8da289f7d76b0cb85c50e6cda0e34e4..29a6d167b46b608d9880492db2c5697aa4c1de33 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,18 +2,17 @@
 # build bin/pharext
 #
 
-all: bin/pharext
+all: bin/pharext bin/pharext.update
 
-bin/pharext: src/* src/pharext/* src/pharext/*/*
+bin/%: build/%.php src/* src/pharext/* src/pharext/*/* src/pharext/*/*/*
        @echo "Linting changed source files ... "
        @for file in $?; do php -l $$file | sed -ne '/^No syntax errors/!p' && exit $${PIPESTATUS[0]}; done
-       @echo "Creating bin/pharext ... "
-       php -d phar.readonly=0 build/create-phar.php
-       chmod +x $@
+       @echo "Creating $@ ... "
+       php -d phar.readonly=0 $<
 
 test:
        @echo "Running tests ... "
-       @phpunit tests
+       @php -dphar.readonly=0 `which phpunit` tests
        
 clean:
        rm bin/pharext*
@@ -22,11 +21,11 @@ release:
        @echo "Previous Version: $$(git tag --list | tail -n1)"; \
        read -p "Release Version:  v" VERSION; \
        echo "Preparing release ... "; \
-       sed -i '' -e "s/@PHAREXT_VERSION@/$$VERSION/" src/pharext/Version.php && \
+       sed -e "s/@dev-master/$$VERSION/" build/Metadata.php.in > src/pharext/Metadata.php && \
        $(MAKE) -B SIGN=1 && \
        git ci -am "release v$$VERSION" && \
        git tag v$$VERSION && \
-       sed -i '' -e "s/$$VERSION/@PHAREXT_VERSION@/" src/pharext/Version.php && \
+       cp build/Metadata.php.in src/pharext/Metadata.php && \
        git ci -am "back to dev"
 
 .PHONY: all clean test release