Makefile 1.39 KB
Newer Older
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
1
ALL: libmbfluid3.so libmbfluid2.so libscontact2.so libscontact3.so
2

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
3
CFLAGS=-Wno-unused-function -O3 -g -march=native -mtune=native -fPIC -std=gnu99 -Iscontact -Ihxt -Isrc
4
5
LDFLAGS=-shared -lm

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
6
FLUID_C=src/fluid_problem.c src/mesh.c src/mesh_find.c scontact/quadtree.c hxt/hxt_linear_system.c hxt/hxt_linear_system_lu.c hxt/hxt_message.c src/mbxml.c src/yxml.c src/fluid_problem_io.c
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
7
FLUID_H=src/tools.h src/fluid_problem.h hxt/hxt_linear_system.h src/mesh_find.h src/mesh.h scontact/quadtree.h scontact/vector.h
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
8
9
10

USE_PETSC=1
ifeq ($(USE_PETSC),1)
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
11
12
13
	FLUID_C += hxt/hxt_linear_system_petsc.c
	CFLAGS += -I${PETSC_DIR}/${PETSC_ARCH}/include -I${PETSC_DIR}/include -I${PETSC_DIR}/include/petsc/mpiuni -DHXT_HAVE_PETSC
	LDFLAGS += -L${PETSC_DIR}/${PETSC_ARCH}/lib -Wl,-rpath=${PETSC_DIR}/${PETSC_ARCH}/lib -lpetsc
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
14
endif
15

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
16
17
SCONTACT_C=scontact/quadtree.c scontact/scontact.c src/mbxml.c src/yxml.c
SCONTACT_H=scontact/quadtree.h scontact/scontact.h src/mbxml.h src/yxml.h
18

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
19
libmbfluid2.so : ${FLUID_C} ${FLUID_H}
20
21
	${CC} ${FLUID_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=2

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
22
23
24
libmbfluid3.so : ${FLUID_C} ${FLUID_H}
	${CC} ${FLUID_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=3

25
26
27
28
29
30
31
32
libscontact2.so : ${SCONTACT_C} ${SCONTACT_H}
	${CC} ${SCONTACT_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=2

libscontact3.so : ${SCONTACT_C} ${SCONTACT_H}
	${CC} ${SCONTACT_C} -o $@ ${CFLAGS} ${LDFLAGS} -DDIMENSION=3

clean :
	${RM} *.so *.pyc -r __pycache__