diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-08-31 11:42:13 -0700 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-08-31 11:42:13 -0700 |
commit | ac7218e335f0393330cf3d1c791ccdfa5a04c423 (patch) | |
tree | 1e864fe75f90fbb2a3d5796deabfe056f6e0537d /auto/modules | |
parent | 6eb4a41364bedc461a58ebe486067ae3abc9aaa1 (diff) | |
download | unit-ac7218e335f0393330cf3d1c791ccdfa5a04c423.tar.gz unit-ac7218e335f0393330cf3d1c791ccdfa5a04c423.tar.bz2 |
Introducing install & uninstall Makefile targets.
Diffstat (limited to 'auto/modules')
-rw-r--r-- | auto/modules/go | 18 | ||||
-rw-r--r-- | auto/modules/php | 19 | ||||
-rw-r--r-- | auto/modules/python | 19 |
3 files changed, 48 insertions, 8 deletions
diff --git a/auto/modules/go b/auto/modules/go index 2076a0bd..847938ea 100644 --- a/auto/modules/go +++ b/auto/modules/go @@ -85,7 +85,7 @@ fi cat << END >> $NXT_MAKEFILE -.PHONY: ${NXT_GO} +.PHONY: ${NXT_GO} ${NXT_GO}-install ${NXT_GO}-uninstall all: ${NXT_GO} @@ -104,16 +104,22 @@ $NXT_BUILD_DIR/nxt_go_gen.h: src/go/unit/*.go ${NXT_GO} build -o $NXT_BUILD_DIR/nxt_go_gen.a \\ --buildmode=c-archive go/unit + +install: ${NXT_GO}-install + ${NXT_GO}-install: ${NXT_GO} - install -d \$(GOPATH)/src/unit - install -p ./src/go/unit/* \$(GOPATH)/src/unit/ + install -d \$(DESTDIR)\$(GOPATH)/src/unit + install -p ./src/go/unit/* \$(DESTDIR)\$(GOPATH)/src/unit/ CGO_CFLAGS="-I\$(NXT_ROOT)/$NXT_BUILD_DIR -I\$(NXT_ROOT)/src" \\ CGO_LDFLAGS="-L\$(NXT_ROOT)/$NXT_BUILD_DIR ${NXT_LIBRT}" \\ - GOPATH=$NXT_GO_PATH \\ + GOPATH=\$(DESTDIR)\$(GOPATH) \\ ${NXT_GO} install -v unit + +uninstall: ${NXT_GO}-uninstall + ${NXT_GO}-uninstall: - rm -rf \$(GOPATH)/src/unit - rm -f \$(GOPATH)/pkg/\$(GOOS)_\$(GOARCH)/unit.a + rm -rf \$(DESTDIR)\$(GOPATH)/src/unit + rm -f \$(DESTDIR)\$(GOPATH)/pkg/\$(GOOS)_\$(GOARCH)/unit.a END diff --git a/auto/modules/php b/auto/modules/php index c8da3fe9..00a1015e 100644 --- a/auto/modules/php +++ b/auto/modules/php @@ -148,7 +148,9 @@ done cat << END >> $NXT_MAKEFILE -.PHONY: ${NXT_PHP_MODULE} +.PHONY: ${NXT_PHP_MODULE} +.PHONY: ${NXT_PHP_MODULE}-install +.PHONY: ${NXT_PHP_MODULE}-uninstall all: ${NXT_PHP_MODULE} @@ -158,4 +160,19 @@ $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so: $nxt_objs $NXT_MODULE_LINK -o $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so \\ $nxt_objs ${NXT_PHP_LIB} ${NXT_PHP_LDFLAGS} + +install: ${NXT_PHP_MODULE}-install + +${NXT_PHP_MODULE}-install: ${NXT_PHP_MODULE} + install -d \$(DESTDIR)$NXT_MODULES + install -p $NXT_BUILD_DIR/${NXT_PHP_MODULE}.unit.so \\ + \$(DESTDIR)$NXT_MODULES/ + + +uninstall: ${NXT_PHP_MODULE}-uninstall + +${NXT_PHP_MODULE}-uninstall: + rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PHP_MODULE}.unit.so + @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true + END diff --git a/auto/modules/python b/auto/modules/python index ba272999..9e3ced74 100644 --- a/auto/modules/python +++ b/auto/modules/python @@ -145,7 +145,9 @@ done cat << END >> $NXT_MAKEFILE -.PHONY: ${NXT_PYTHON_MODULE} +.PHONY: ${NXT_PYTHON_MODULE} +.PHONY: ${NXT_PYTHON_MODULE}-install +.PHONY: ${NXT_PYTHON_MODULE}-uninstall all: ${NXT_PYTHON_MODULE} @@ -155,4 +157,19 @@ $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so: $nxt_objs $NXT_MODULE_LINK -o $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so \\ $nxt_objs $NXT_PYTHON_LIBS + +install: ${NXT_PYTHON_MODULE}-install + +${NXT_PYTHON_MODULE}-install: ${NXT_PYTHON_MODULE} + install -d \$(DESTDIR)$NXT_MODULES + install -p $NXT_BUILD_DIR/${NXT_PYTHON_MODULE}.unit.so \\ + \$(DESTDIR)$NXT_MODULES/ + + +uninstall: ${NXT_PYTHON_MODULE}-uninstall + +${NXT_PYTHON_MODULE}-uninstall: + rm -f \$(DESTDIR)$NXT_MODULES/${NXT_PYTHON_MODULE}.unit.so + @rmdir -p \$(DESTDIR)$NXT_MODULES 2>/dev/null || true + END |