aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorRuben Undheim <ruben.undheim@gmail.com>2015-10-11 00:56:20 +0200
committerRuben Undheim <ruben.undheim@gmail.com>2015-10-11 00:56:20 +0200
commit978933704b496e36699067ce4893946c6030e52c (patch)
tree14b40203112edcf33ca3ea6f86bc85676f536ccf /Makefile
parent2792b00792e4f78ee2e0e23627bb20f0e2669593 (diff)
downloadyosys-978933704b496e36699067ce4893946c6030e52c.tar.gz
yosys-978933704b496e36699067ce4893946c6030e52c.tar.bz2
yosys-978933704b496e36699067ce4893946c6030e52c.zip
Use DESTDIR as defined in https://www.gnu.org/prep/standards/html_node/DESTDIR.html
This is needed for painless packaging of yosys
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 13 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index d2508c5a0..cc12dc352 100644
--- a/Makefile
+++ b/Makefile
@@ -18,11 +18,11 @@ ENABLE_LIBYOSYS := 0
ENABLE_GPROF := 0
ENABLE_NDEBUG := 0
-DESTDIR := /usr/local
+PREFIX ?= /usr/local
INSTALL_SUDO :=
-TARGET_BINDIR := $(DESTDIR)/bin
-TARGET_DATDIR := $(DESTDIR)/share/yosys
+TARGET_BINDIR := $(DESTDIR)$(PREFIX)/bin
+TARGET_DATDIR := $(DESTDIR)$(PREFIX)/share/yosys
EXE =
OBJS =
@@ -39,8 +39,8 @@ all: top-all
YOSYS_SRC := $(dir $(firstword $(MAKEFILE_LIST)))
VPATH := $(YOSYS_SRC)
-CXXFLAGS += -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -D_YOSYS_ -fPIC -I$(DESTDIR)/include
-LDFLAGS += -L$(DESTDIR)/lib
+CXXFLAGS += -Wall -Wextra -ggdb -I. -I"$(YOSYS_SRC)" -MD -D_YOSYS_ -fPIC -I$(DESTDIR)$(PREFIX)/include
+LDFLAGS += -L$(DESTDIR)$(PREFIX)/lib
LDLIBS = -lstdc++ -lm
SED = sed
BISON = bison
@@ -378,20 +378,20 @@ vloghtb: $(TARGETS) $(EXTRA_TARGETS)
@echo ""
install: $(TARGETS) $(EXTRA_TARGETS)
- $(INSTALL_SUDO) mkdir -p $(DESTDIR)/bin
- $(INSTALL_SUDO) install $(TARGETS) $(DESTDIR)/bin/
- $(INSTALL_SUDO) mkdir -p $(DESTDIR)/share/yosys
- $(INSTALL_SUDO) cp -r share/. $(DESTDIR)/share/yosys/.
+ $(INSTALL_SUDO) mkdir -p $(DESTDIR)$(PREFIX)/bin
+ $(INSTALL_SUDO) install $(TARGETS) $(DESTDIR)$(PREFIX)/bin/
+ $(INSTALL_SUDO) mkdir -p $(DESTDIR)$(PREFIX)/share/yosys
+ $(INSTALL_SUDO) cp -r share/. $(DESTDIR)$(PREFIX)/share/yosys/.
ifeq ($(ENABLE_LIBYOSYS),1)
- $(INSTALL_SUDO) cp libyosys.so $(DESTDIR)/lib/
+ $(INSTALL_SUDO) cp libyosys.so $(DESTDIR)$(PREFIX)/lib/
$(INSTALL_SUDO) ldconfig
endif
uninstall:
- $(INSTALL_SUDO) rm -vf $(addprefix $(DESTDIR)/bin/,$(notdir $(TARGETS)))
- $(INSTALL_SUDO) rm -rvf $(DESTDIR)/share/yosys/
+ $(INSTALL_SUDO) rm -vf $(addprefix $(DESTDIR)$(PREFIX)/bin/,$(notdir $(TARGETS)))
+ $(INSTALL_SUDO) rm -rvf $(DESTDIR)$(PREFIX)/share/yosys/
ifeq ($(ENABLE_LIBYOSYS),1)
- $(INSTALL_SUDO) rm -vf $(DESTDIR)/lib/libyosys.so
+ $(INSTALL_SUDO) rm -vf $(DESTDIR)$(PREFIX)/lib/libyosys.so
endif
update-manual: $(TARGETS) $(EXTRA_TARGETS)