forked from DarkOfTheMoon/wlb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
66 lines (50 loc) · 1.96 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
################################################################################
# #
# Core Makefile for Lattice Boltzmann code WLB #
# #
# To use the wlb library, compile the code, if everything goes well, you will #
# get a wlblib.so file which you may use to link with your code. See the #
# examples folder for details. #
# #
# The code is tested on a UNIX 64 bit system. #
# #
# #
# Andreas Bülling, 2013 #
# #
################################################################################
# Path definitions
SRCDIR = src
TESTDIR = $(SRCDIR)/tests
TOPDIR = .
OBJDIR = build
SUBDIRS = col lat str bdr unit io
CPPDIRS = $(addprefix $(SRCDIR)/, $(SUBDIRS)) $(SRCDIR)
VPATH = $(CPPDIRS)
CPPSRCS = $(addsuffix /*.cpp, $(CPPDIRS))
SRCS = $(wildcard $(CPPSRCS))
OBJS = $(addprefix $(OBJDIR)/, $(notdir $(SRCS:.cpp=.o)))
VPATH = $(CPPDIRS)
# C++ compiler
CPP = g++
# Compiler options
CPPFLAGS = -O2 -fopenmp -fPIC#-pg
# Linker options
LDFLAGS =
# Libraries to link to
LIBS = -lm
# Build rules
.PHONY: print all clean
all: $(OBJDIR) libwlb.so
$(OBJDIR):
mkdir $(OBJDIR)
$(OBJDIR)/%.o: %.cpp
$(CPP) $(CPPFLAGS) -c $< -o $@
libwlb.so: $(OBJS)
$(CPP) -shared -o $@ $(CPPFLAGS) $(OBJS) $(LIBS)
clean:
rm -f a.out $(OBJDIR)/*.o *.o libwlb.so
print:
echo $(SRCS)
echo $(OBJS)
echo $(CPPDIRS)