Makefile 2.3 KB
Newer Older
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
1
# Marblesbag - Copyright (C) <2010-2018>
2
3
# <Universite catholique de Louvain (UCL), Belgium>
# <Universite de Montpellier, France>
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 	
# List of the contributors to the development of SLIM: see AUTHORS file.
# Description and complete License: see LICENSE file.
# 	
# This program (Marblesbag) is free software: 
# you can redistribute it and/or modify it under the terms of the GNU General 
# Public License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program (see COPYING file).  If not, 
# see <http://www.gnu.org/licenses/>.

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
22
ALL: libmbfluid3.so libmbfluid2.so libscontact2.so libscontact3.so
23

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

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
27
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
28
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
29
30
31

USE_PETSC=1
ifeq ($(USE_PETSC),1)
Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
32
33
34
	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
35
endif
36

Jonathan Lambrechts's avatar
Jonathan Lambrechts committed
37
38
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
39

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

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

46
47
48
49
50
51
52
53
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__