summaryrefslogtreecommitdiffhomepage
path: root/auto/make
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--auto/make13
1 files changed, 11 insertions, 2 deletions
diff --git a/auto/make b/auto/make
index 392cf059..9af63c97 100644
--- a/auto/make
+++ b/auto/make
@@ -204,11 +204,20 @@ done
cat << END >> $NXT_MAKEFILE
-.PHONY: install ${NXT_DAEMON}-install
+.PHONY: install ${NXT_DAEMON}-install install-check
install: ${NXT_DAEMON}-install
-${NXT_DAEMON}-install: $NXT_DAEMON
+install-check:
+ @test -n "\$(DESTDIR)$NXT_PREFIX" \\
+ || (echo; \\
+ echo "error: to make install you need either"; \\
+ echo " to configure --prefix option"; \\
+ echo " or to set DESTDIR environment variable."; \\
+ echo; \\
+ exit 1)
+
+${NXT_DAEMON}-install: $NXT_DAEMON install-check
install -d \$(DESTDIR)$NXT_SBINDIR
install -p $NXT_BUILD_DIR/$NXT_DAEMON \$(DESTDIR)$NXT_SBINDIR/
install -d \$(DESTDIR)$NXT_STATE