-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathmakefile
More file actions
35 lines (27 loc) · 680 Bytes
/
Copy pathmakefile
File metadata and controls
35 lines (27 loc) · 680 Bytes
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
# LIFE makefile
# Compiler command
CC=g++
CFLAGS=-O3 -std=c++0x -fopenmp -Wall -Wextra
# Executable
EXE=LIFE
# Location of source, header and object files
DIR=.
SDIR=$(DIR)/src
HDIR=$(DIR)/inc
ODIR=$(DIR)/obj
# Get the sources and object files
SRCS:=$(wildcard $(SDIR)/*.cpp)
OBJS:=$(addprefix $(ODIR)/,$(notdir $(SRCS:.cpp=.o)))
# Include and library files
INC=
LIB=-llapack -lboost_system -lboost_filesystem
# Build LIFE
$(EXE): $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIB)
# Build object files
$(OBJS): $(ODIR)/%.o : $(SDIR)/%.cpp
$(CC) $(CFLAGS) $(INC) -c -o $@ $<
# Clean the project
.PHONY: clean
clean:
rm -rf $(EXE) $(ODIR) Results *.out && mkdir $(ODIR)