-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
41 lines (32 loc) · 942 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
.PHONY: clean gdb
EXEC=correlate
MAINOBJ:=src/core/main.o
CC=mpicc
CXX=mpicxx
LD=mpicxx
LDLIBS+= -lboost_filesystem -lboost_system -lboost_program_options
CPPFLAGS+= -Isrc/core -Isrc/atomgroup -Isrc/reader -Isrc/writer -Isrc/file -Isrc/kernel -Isrc/util -Isrc/exception
CPPFLAGS+= -fdiagnostics-color=always -std=c++11 -g -Wall
CPPFLAGS+= -O3
include gather.make
include cuda.make
DEPS=src/util/version.o
DEPS+= $(MAINOBJ)
DEPS+= $(COREOBJ)
DEPS+= $(AGOBJ)
DEPS+= $(READEROBJ)
DEPS+= $(WRITEROBJ)
DEPS+= $(FILEOBJ)
DEPS+= $(UTILOBJ)
DEPS+= $(KERNOBJ)
$(EXEC): $(DEPS)
$(LD) -o $@ $^ $(LDFLAGS) $(LDLIBS)
src/util/version.cpp: .git/HEAD .git/index
echo "const char *version = \"$(shell git describe --abbrev=4 --dirty --always --tags)\";" > $@
echo "const char *build_date = \"$(shell date)\";" >> $@
$(CUDAOBJ): $(CUDASRC)
nvcc $(CUDAFLAGS) -c -o $@ $<
gdb: $(EXEC)
gdb -x gdbinit $(EXEC)
clean:
rm -f $(EXEC) $(DEPS)