-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (30 loc) · 848 Bytes
/
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
EXEC= MD
CC=g++
CPPFLAGS=-O3 -fopenmp -std=c++11
SUBDIRS= ./analysis ./analysis/asciiMod ./analysis/xyzMod ./analysis/functions
TARGETS: $(EXEC) all
#To make an intel target, MD built with intel is about 10-20% faster
#CC=icc
#CPPFLAGS=-fast -qopenmp
ifeq ($(PREFIX),)
PREFIX=$(HOME)
endif
cuda:
nvcc -Xcompiler -fopenmp -std=c++14 MDcuda.cu -O3 --gpu-architecture=compute_70 -o MDcuda
.PHONY: all
all: $(TARGETS)
for dir in $(SUBDIRS); do $(MAKE) -C $$dir; done
.PHONY: generate
generate:
@echo $(MAKE) -C ./generate all
$(TARGET):
@echo $(CC) -o $(TARGET) $(TARGET).cpp $(CPPFLAGS)
.PHONY: clean
clean:
rm -f MDcuda
rm -f $(EXEC)
for dir in $(SUBDIRS); do $(MAKE) -C $$dir clean; done
install: $(EXEC)
install -d $(PREFIX)/bin/
install -m 755 $(EXEC) $(PREFIX)/bin/
for dir in $(SUBDIRS); do $(MAKE) -C $$dir install; done