-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
39 lines (25 loc) · 892 Bytes
/
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
35
36
37
38
39
CFLAGS = -Wall -std=c99 -pedantic
CC = clang
##
## We can define variables for values we will use repeatedly below
##
# LIB = libphylib.so
# OBJS = phylib.o
## top level target -- build all the dependent executables
# all : $(EXE)
all : _phylib.so
## targets for each executable, based on the object files indicated
phylib_wrap.c:
swig -python phylib.i
phylib_wrap.o : phylib_wrap.c
$(CC) $(CFLAGS) -c phylib_wrap.c -I/usr/include/python3.10 -fPIC -o phylib_wrap.o
_phylib.so : phylib_wrap.o libphylib.so
$(CC) $(CFLAGS) phylib_wrap.o -shared -L. -L/usr/lib/python3.10 -lpython3.11 -lphylib -o _phylib.so
phylib.o : phylib.c phylib.h
$(CC) $(CFLAGS) -fPIC -c phylib.c -o phylib.o
libphylib.so : phylib.o
$(CC) -shared -o libphylib.so phylib.o -lm
## convenience target to remove the results of a build
clean :
- rm -f *.o *.so
## Magic line: export LD_LIBRARY_PATH=`pwd`