-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (47 loc) · 1.37 KB
/
Makefile
File metadata and controls
62 lines (47 loc) · 1.37 KB
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
#
# LEDy, Loop-extrusion molecular dynamics. Code is hosted on GitHub.
#
# File: Makefile
#
# Authors:
# Martina Crippa <martina.crippa2@studenti.unimi.it>
#
################################################################################
# configure multithreaded compilation
OS := $(shell uname)
ifeq ($(OS), Linux)
export MAKEFLAGS="-j $(grep -c ^processor /proc/cpuinfo)"
else ifeq ($(OS), Darwin)
export MAKEFLAGS="-j $(sysctl-n hw.ncpu)"
endif
# search in VPATH for source file
VPATH=./source/
# place object file in OBJPATH
OBJPATH=./obj/
CXX := $(GCC47_BINDIR)$(CXX)
TARGET := LEAD
OBJS := $(patsubst %.o,$(OBJPATH)%.o, parameters.o polymer.o potential.o integrator.o dynamics.o extruder.o vector_extruder.o)
DEBUG := -g
WARNING := -Wall -Wextra
CXXFLAGS := $(CXXFLAGS) -std=c++17 -O3 -ffast-math -funroll-loops
#LDFLAGS := -lpthread -lCGAL -lboost_system -lgmp
LDFLAGS := -lpthread
all: $(TARGET)
LEAD: $(OBJS) $(OBJPATH)main.o
$(CXX) -o $@ $(OBJS) $(OBJPATH)main.o $(CXXFLAGS) $(LDFLAGS)
$(OBJPATH)main.o: main.cpp $(OBJS)
$(CXX) -c $< -o $@ $(CXXFLAGS)
$(OBJPATH)%.o: %.cpp %.h
ifeq ($(wildcard $(OBJPATH)*),) #search for obj path, create it if it doesn't exist
@mkdir -p $(OBJPATH)
endif
$(CXX) -c $< -o $@ $(CXXFLAGS)
.PHONY: run clean
run:
./$(TARGET)
clean:
/bin/rm -f $(OBJPATH)*.o
/bin/rm -f $(TARGET)
rmout:
/bin/rm ./output/*
# vim: set noexpandtab: