summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-02-25 00:05:16 +0800
committerruki <[email protected]>2020-02-24 18:31:40 +0800
commit60d476560c1332b9f80ce71625381e7acb207f13 (patch)
treeb6f2b61148cbc0208e09545fd3b8a51bda3b234f
parent61dfa4d694a9ba09a99d243e5ca06e2d34b4cbdd (diff)
update makefile
-rw-r--r--makefile18
-rwxr-xr-xscripts/PKGBUILD2
2 files changed, 10 insertions, 10 deletions
diff --git a/makefile b/makefile
index 6759be49d..5587b9642 100644
--- a/makefile
+++ b/makefile
@@ -6,7 +6,7 @@ verbose :=
#verbose :=-v
# prefix
-ifeq ($(prefix),) # compatible with brew script (make install prefix=xxx DESTDIR=/xxx)
+ifeq ($(prefix),) # compatible with brew script (make install PREFIX=xxx DESTDIR=/xxx)
ifeq ($(PREFIX),)
prefix :=$(if $(findstring /usr/local/bin,$(PATH)),/usr/local,/usr)
else
@@ -75,25 +75,25 @@ ifeq ($(PLAT),cygwin)
iswin = yes
endif
-DESTDIR :=$(if $(DESTDIR),$(DESTDIR),$(prefix))
-xmake_dir_install :=$(DESTDIR)/share/xmake
+destdir :=$(if $(DESTDIR),$(DESTDIR)/$(prefix),$(prefix))
+xmake_dir_install :=$(destdir)/share/xmake
xmake_dir_install2 :=$(prefix)/share/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 :=$(DESTDIR)/bin/xmake.exe
+xmake_core_install :=$(destdir)/bin/xmake.exe
xmake_core_install2 :=$(prefix)/bin/xmake.exe
else
xmake_core_install :=$(xmake_dir_install)/xmake
xmake_core_install2 :=$(xmake_dir_install2)/xmake
endif
xmake_loader :=$(TMP_DIR)/xmake_loader
-xmake_loader_install:=$(DESTDIR)/bin/xmake
+xmake_loader_install:=$(destdir)/bin/xmake
tip:
@echo 'Usage: '
@echo ' $ make build'
- @echo ' $ sudo make install [prefix=/usr/local] [DESTDIR=/xxx]'
+ @echo ' $ sudo make install [PREFIX=/usr/local] [DESTDIR=/xxx]'
build:
@echo compiling xmake-core ...
@@ -103,14 +103,14 @@ build:
@$(MAKE) -C core --no-print-directory
install:
- @echo installing to $(DESTDIR) ...
+ @echo installing to $(destdir) ...
@echo plat: $(PLAT)
@echo arch: $(ARCH)
@# 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 bin directory exists for PKGBUILD/pkg
- @if [ ! -d $(DESTDIR)/bin ]; then mkdir -p $(DESTDIR)/bin; fi
+ @if [ ! -d $(destdir)/bin ]; then mkdir -p $(destdir)/bin; fi
@# install the xmake core file
@cp $(xmake_core) $(xmake_core_install)
@chmod 777 $(xmake_core_install)
@@ -129,7 +129,7 @@ install:
@echo ok!
uninstall:
- @echo uninstalling from $(DESTDIR) ...
+ @echo uninstalling from $(destdir) ...
@if [ -f $(xmake_loader_install) ]; then rm $(xmake_loader_install); fi
@if [ -d $(xmake_dir_install) ]; then rm -rf $(xmake_dir_install); fi
@echo ok!
diff --git a/scripts/PKGBUILD b/scripts/PKGBUILD
index cc3509948..af3f4a7c3 100755
--- a/scripts/PKGBUILD
+++ b/scripts/PKGBUILD
@@ -21,5 +21,5 @@ build() {
package() {
cd "$srcdir"
- make install DESTDIR="${pkgdir}/usr" PREFIX="/usr"
+ make install DESTDIR="${pkgdir}" PREFIX="/usr"
}