summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-24 22:43:06 +0800
committerruki <[email protected]>2020-02-24 10:18:41 +0800
commit3b89935a030aae6f6904121fb5ab16e2ade21513 (patch)
tree6055595c9da73976cc114a6a6dbb6ef53f81f970
parent63a3b4467308dac5e0dc5ea52eb7dd43a776fed8 (diff)
fix make install for PKGBUILD
-rw-r--r--makefile11
1 files changed, 8 insertions, 3 deletions
diff --git a/makefile b/makefile
index d77065639..05b3846fa 100644
--- a/makefile
+++ b/makefile
@@ -75,16 +75,18 @@ ifeq ($(PLAT),cygwin)
iswin = yes
endif
-xmake_dir_install :=$(prefix)/share/xmake
+prefix_bindir :=$(prefix)/bin
+prefix_sharedir :=$(prefix)/share
+xmake_dir_install :=$(prefix_sharedir)/xmake
xmake_core :=./core/src/demo/demo.b
ifdef iswin
# we need load msys-2.0.dll or cygwin1.dll on bin directory
-xmake_core_install :=$(prefix)/bin/xmake.exe
+xmake_core_install :=$(prefix_bindir)/xmake.exe
else
xmake_core_install :=$(xmake_dir_install)/xmake
endif
xmake_loader :=$(TMP_DIR)/xmake_loader
-xmake_loader_install:=$(prefix)/bin/xmake
+xmake_loader_install:=$(prefix_bindir)/xmake
tip:
@echo 'Usage: '
@@ -105,6 +107,9 @@ install:
@# create the xmake install directory
@if [ -d $(xmake_dir_install) ]; then rm -rf $(xmake_dir_install); fi
@if [ ! -d $(xmake_dir_install) ]; then mkdir -p $(xmake_dir_install); fi
+ @# ensure prefix directory exists for PKGBUILD/pkg
+ @if [ ! -d $(prefix_bindir) ]; then mkdir -p $(prefix_bindir); fi
+ @if [ ! -d $(prefix_sharedir) ]; then mkdir -p $(prefix_sharedir); fi
@# install the xmake core file
@cp $(xmake_core) $(xmake_core_install)
@chmod 777 $(xmake_core_install)