Add install rule to Makefile

This commit is contained in:
Les De Ridder 2017-10-30 02:30:53 +01:00
parent 3cdd941748
commit 455b6dec2f
1 changed files with 11 additions and 4 deletions

View File

@ -1,9 +1,8 @@
CC = clang
CFLAGS = -fPIC -Wall -Wextra -O
LDFLAGS = -shared
PREFIX ?= /usr
.PHONY: all clean
.PHONY: all
all: libbuse.so
libbuse.so: buse.o
@ -12,5 +11,13 @@ libbuse.so: buse.o
buse.o: buse.c
$(CC) $(CFLAGS) -c -o $@ $^
.PHONY: install
install: libbuse.so
mkdir -p $(DESTDIR)$(PREFIX)/lib
mkdir -p $(DESTDIR)$(PREFIX)/include
cp libbuse.so $(DESTDIR)$(PREFIX)/lib/
cp buse.h $(DESTDIR)$(PREFIX)/include/
.PHONY: clean
clean:
rm -f buse.o libbuse.so
$(RM) buse.o libbuse.so