-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (26 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CPPFLAGS += -I.
CFLAGS += -fPIC
PREFIX ?= /usr/local
all: libtbl.a libtbl.so.1 example euler
clean:
rm -f libtbl.a libtbl.so* libtbl.o
libtbl.a: libtbl.o
ar cr libtbl.a libtbl.o
libtbl.so.1: libtbl.o
${CC} -shared -Xlinker --soname=libtbl.so.1 -o libtbl.so.1 libtbl.o
euler: libtbl.a euler.c
${CC} -static -o euler euler.c libtbl.a -lm
example: libtbl.a example.c
${CC} -static -o example example.c libtbl.a -lm
install:
mkdir -p ${DESTDIR}${PREFIX}/include
mkdir -p ${DESTDIR}${PREFIX}/lib
mkdir -p ${DESTDIR}${PREFIX}/share/examples/libtbl
mkdir -p ${DESTDIR}${PREFIX}/share/man/man3
cp libtbl.h ${DESTDIR}${PREFIX}/include
cp libtbl.a ${DESTDIR}${PREFIX}/lib
cp libtbl.so.1 ${DESTDIR}${PREFIX}/lib/libtbl.so.1.0.0
ln -fs ${DESTDIR}${PREFIX}/lib/libtbl.so.1.0.0 ${DESTDIR}${PREFIX}/lib/libtbl.so.1
ln -fs ${DESTDIR}${PREFIX}/lib/libtbl.so.1 ${DESTDIR}${PREFIX}/lib/libtbl.so
cp euler.c example.c ${DESTDIR}${PREFIX}/share/examples/libtbl/
gzip < libtbl.3 > ${DESTDIR}${PREFIX}/share/man/man3/libtbl.3.gz