-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmakefile.occa
48 lines (34 loc) · 1.01 KB
/
makefile.occa
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
ifndef OCCA_DIR
ERROR:
@echo "Error, environment variable [OCCA_DIR] is not set"
endif
CXXFLAGS =
include ${OCCA_DIR}/scripts/makefile
# define variables
HDRDIR = ./
# set options for this machine
# specify which compilers to use for c, fortran and linking
cc = gcc
CC = g++
LD = g++
# compiler flags to be used (set to compile with debugging on)
CFLAGS = -O3 -I$(HDRDIR) -I/opt/local/include/
# link flags to be used
LDFLAGS = $(compilerFlags) $(flags) -O3
# libraries to be linked in
LIBS = $(links) -llapack -lblas -L/opt/local/lib/ -lpng
# types of files we are going to construct rules for
.SUFFIXES: .c
# rule for .c files
.c.o:
$(cc) $(CFLAGS) -o $*.o -c $*.c $(paths)
.cpp.o:
$(CC) $(CFLAGS) -o $*.o -c $*.cpp $(paths)
# list of objects to be compiled
OBJS = \
png_util.o
occaLBM:$(AOBJS) $(OBJS) occaLBM.o
$(LD) $(LDFLAGS) -o occaLBM occaLBM.o $(OBJS) $(paths) $(LIBS)
# what to do if user types "make clean"
clean :
rm -r $(OBJS) occaLBM.o