Skip to content

Commit 74700b2

Browse files
authored
Proper installation paths
It's Makefile convention to be able to install to `DESTDIR`. This is especially important for packaging on Linux distributions but might be convenient for other users as well. Also this introduces `PREFIX`, another convention.
1 parent 7d16bc8 commit 74700b2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
LIBTOOL ?= libtool
2-
LIBDIR ?= /usr/lib
2+
PREFIX ?= /usr
3+
INCLUDEDIR ?= ${PREFIX}/include/pystring
4+
LIBDIR ?= ${PREFIX}/lib
35
CXX ?= g++
46
CXXFLAGS ?= -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2
57

@@ -12,7 +14,8 @@ libpystring.la: pystring.lo
1214
$(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $< -rpath $(LIBDIR)
1315

1416
install: libpystring.la
15-
$(LIBTOOL) --mode=install install -c $< $(LIBDIR)/$<
17+
$(LIBTOOL) --mode=install install -Dm755 $< $(DESTDIR)$(LIBDIR)/$<
18+
$(LIBTOOL) --mode=install install -Dm644 pystring.h $(DESTDIR)$(INCLUDEDIR)/pystring.h
1619

1720
clean:
1821
$(RM) -fr pystring.lo pystring.o libpystring.la .libs

0 commit comments

Comments
 (0)