Implement 'make install DESTDIR=target'.

This commit is contained in:
Petter Reinholdtsen 2016-07-10 20:13:37 +00:00
parent ac9f6c7420
commit 781409b49e
3 changed files with 16 additions and 1 deletions

View File

@ -2,3 +2,7 @@ ROOT := .
DIRS := libcoz benchmarks
include $(ROOT)/common.mk
install::
$(INSTALL) -D coz $(DESTDIR)$(bindir)/coz
$(INSTALL) -D include/coz.h $(DESTDIR)$(incdir)/coz.h

View File

@ -1,3 +1,11 @@
DESTDIR =
prefix = /usr
bindir = $(prefix)/bin
pkglibdir = $(prefix)/lib/coz-profiler
incdir = $(prefix)/include
INSTALL = install
# Build with clang
CC := clang
CXX := clang++
@ -19,7 +27,7 @@ SRCS ?= $(wildcard *.cpp) $(wildcard *.c)
OBJS ?= $(addprefix obj/,$(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRCS))))
# Targets to build recirsively into $(DIRS)
RECURSIVE_TARGETS ?= all clean bench test
RECURSIVE_TARGETS ?= all clean bench test install
# Build in parallel
MAKEFLAGS := -j

View File

@ -6,3 +6,6 @@ CXXFLAGS := --std=c++11 -g -O2 -fPIC -I$(ROOT)/include
PREREQS := $(ROOT)/deps/ccutil $(ROOT)/deps/libelfin
include $(ROOT)/common.mk
install::
$(INSTALL) -D $(ROOT)/libcoz/libcoz.so $(DESTDIR)$(pkglibdir)/libcoz.so