-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (22 loc) · 884 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
BUILDDIR := ./build
SRCDIR := ./src
OPTDIR := ./opt
LDFLAGS := -L${OPTDIR}/lib -lblis
CXXFLAGS := -I${OPTDIR}/include -I$(SRCDIR) -std=c++11 -fopenmp -O3 -ffast-math -march=native -DEIGEN_NO_DEBUG
SOURCES := $(shell find ${SRCDIR} -name *.cpp)
OBJECTS := $(patsubst ${SRCDIR}/%.cpp, ${BUILDDIR}/src/%.o, ${SOURCES})
EXECS := $(patsubst ${BUILDDIR}/src/%.o, ${BUILDDIR}/%, ${OBJECTS})
all: ${EXECS}
${BUILDDIR}/eigen: ${BUILDDIR}/src/eigen.o
${CXX} ${CXXFLAGS} $^ -o $@
${BUILDDIR}/blis: ${BUILDDIR}/src/blis.o
${CXX} ${CXXFLAGS} $^ ${LDFLAGS} -o $@
${BUILDDIR}/eigen_blis: ${BUILDDIR}/src/eigen_blis.o
${CXX} ${CXXFLAGS} $^ ${LDFLAGS} -o $@
${BUILDDIR}/src/%.o : ${SRCDIR}/%.cpp
@mkdir -p $(@D)
${CXX} ${CXXFLAGS} -MM -MT $@ $< > $(patsubst %.o, %.d, $@)
${CXX} ${CXXFLAGS} -c $< -o $@
clean:
@rm -rf ${BUILDDIR}/*
-include $(OBJECTS:.o=.d)