-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
executable file
·43 lines (31 loc) · 891 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
43
# Author: Karl Stratos ([email protected])
# Compiler.
CC = clang++
# Warning level.
WARN = -Wall
# Optimization level.
OPT = -O3
# Where to find the SVDLIBC package.
SVDLIBC = third_party/SVDLIBC
# Where to find the Eigen package.
EIGEN = third_party/eigen-eigen-36fd1ba04c12
# Compiler flags
CFLAGS = $(WARN) $(OPT) -pthread -std=c++11
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
# Tested on Apple (Darwin) clang version 4.0 (based on LLVM 3.1svn)
CFLAGS += -stdlib=libc++
endif
# Extract object filenames by substituting ".cc" to ".o" in source filenames.
files = $(subst .cc,.o,$(shell ls *.cc) $(shell ls src/*.cc))
all: singular
singular: $(files) $(SVDLIBC)/libsvd.a
$(CC) $(CFLAGS) $^ -o $@
%.o: %.cc
$(CC) -c $< -o $@ -I $(EIGEN) $(CFLAGS)
$(SVDLIBC)/libsvd.a:
make -C $(SVDLIBC)
.PHONY: clean
clean:
rm -rf *.o src/*.o singular
make -C $(SVDLIBC) clean