Skip to content

Commit 0522397

Browse files
committed
Build and install shared library
1 parent 93b9200 commit 0522397

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
*.a
33
*.o
44
*.o.debug
5+
*.so

Makefile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,13 @@ generator.o.debug: src/generator.c
5656
waveform.o.debug: src/waveform.c
5757
$(CC) -c $(DEBUG_CFLAGS) $(INCLUDE) $(FPIC) src/waveform.c -o waveform.o.debug
5858

59+
DESTDIR ?= /usr/local
60+
5961
.PHONY: install
60-
install:
61-
cp libpoly.a /usr/local/lib/
62-
chown root /usr/local/lib/libpoly.a
63-
chmod 0755 /usr/local/lib/libpoly.a
64-
cp include/poly.h /usr/local/include/
65-
chown root /usr/local/include/poly.h
66-
chmod 0755 /usr/local/include/poly.h
62+
install: shared libpoly.a
63+
install -m 0755 libpoly.a $(DESTDIR)/lib
64+
install -m 0755 include/poly.h $(DESTDIR)/include
65+
install -m 0755 libpoly.so $(DESTDIR)/lib
6766

6867
.PHONY: clean
6968
clean:

0 commit comments

Comments
 (0)