diff options
| author | Ben Fuhrmannek | 2022-01-07 19:53:52 +0100 |
|---|---|---|
| committer | Ben Fuhrmannek | 2022-01-07 19:53:52 +0100 |
| commit | 1700aa6192fe874c094e8f794c6803320ce72b42 (patch) | |
| tree | 16c03f2d834271169fc91ef06e45e0814b7e2f62 | |
| parent | ca3b1fc0afc78646d3474da0c9fca409673a217b (diff) | |
added docker start rule and linked-clone to makefile
| -rw-r--r-- | Makefile | 22 |
1 files changed, 18 insertions, 4 deletions
| @@ -8,15 +8,29 @@ clean: ## clean everything | |||
| 8 | release: ## compile with releases flags | 8 | release: ## compile with releases flags |
| 9 | cd src; phpize | 9 | cd src; phpize |
| 10 | cd src; ./configure --enable-snuffleupagus | 10 | cd src; ./configure --enable-snuffleupagus |
| 11 | make -C src | 11 | make -C src -j4 clean all |
| 12 | 12 | ||
| 13 | install: release ## compile and install snuffleupagus | 13 | install: release ## compile and install snuffleupagus |
| 14 | make -C src install | 14 | make -C src install |
| 15 | 15 | ||
| 16 | compile_debug: ## compile a debug build | 16 | compile_debug: ## compile a debug build |
| 17 | cd src; phpize | 17 | cd src; if [[ ! -f configure ]]; then phpize; fi; \ |
| 18 | export CFLAGS="-g3 -ggdb -O1 -g"; cd src; ./configure --enable-snuffleupagus --enable-debug | 18 | ./configure --enable-snuffleupagus --enable-debug --enable-debug-stderr |
| 19 | make -C src | 19 | make -C src -j4 clean all |
| 20 | |||
| 21 | DOCKER_IMAGE := php:latest | ||
| 22 | docker: ## start docker container with current PHP | ||
| 23 | @echo "starting new docker container with snuffleupagus bind-mounted to /sp" | ||
| 24 | docker run -it -v "$$(pwd)":/sp $(DOCKER_IMAGE) /bin/bash | ||
| 25 | |||
| 26 | linked-clone: | ||
| 27 | @if [[ "$(CLONE)" == "" ]]; then echo "Please provide clone name, e.g.\n make linked-clone CLONE=php8.1"; exit 1; fi | ||
| 28 | @if [[ -d "src-$(CLONE)" ]]; then echo "Clone '$(CLONE)' already exists."; exit 1; fi | ||
| 29 | @echo "creating linked clone in 'src-$(CLONE)'..." | ||
| 30 | mkdir "src-$(CLONE)"; cd "src-$(CLONE)"; \ | ||
| 31 | SRC=../src; ln -s $$SRC/*.[hc] $$SRC/config.m4 $$SRC/snuffleupagus.php $$SRC/Makefile.frag $$SRC/*.re .; \ | ||
| 32 | cp -r $$SRC/tests . | ||
| 33 | @echo "done. go ahead and do phpize/configure/make" | ||
| 20 | 34 | ||
| 21 | tests: release ## compile a release build and run the testsuite | 35 | tests: release ## compile a release build and run the testsuite |
| 22 | TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 SP_SKIP_OLD_PHP_CHECK=1 make -C src test | 36 | TEST_PHP_ARGS='-q' REPORT_EXIT_STATUS=1 SP_SKIP_OLD_PHP_CHECK=1 make -C src test |
