-
Notifications
You must be signed in to change notification settings - Fork 5
/
makefile
48 lines (34 loc) · 1.2 KB
/
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
44
45
46
47
48
RM := rm -rf
# Compiler that we are using
CC=icpc
# Optimization levels and any other flags
CFLAGS=-O3 -xT
# Standard libraries that we will use for all the files
LIBS := -openmp -openmp-task intel -lm
# Any specific libraries needed by the particular executable
FJLT_LIBS := -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core
# All executable specific object files that need to be compiled.
FJLT_OBJS := fjtest.o fjlt.o io.o
KTRE_OBJS := kdtest.o parSort.o rerank.o build_tree.o myRNG.o
MAIN_OBJS := main.o fjlt.o io.o parSort.o rerank.o build_tree.o myRNG.o
# All objects files for easier cleanup
OBJS := $(FJLT_OBJS) $(KTRE_OBJS) $(MAIN_OBJS)
# Executables we are producing
EXECUTABLES := fjlt kdtree main
all: $(EXECUTABLES)
# Linking step for each executable
fjlt: $(FJLT_OBJS)
@echo 'Building target: $@'
$(CC) -o $@ $(FJLT_OBJS) $(FJLT_LIBS) $(LIBS)
kdtree: $(KTRE_OBJS)
@echo 'Building target: $@'
$(CC) -o $@ $(KTRE_OBJS) $(KTRE_LIBS) $(LIBS)
main: $(MAIN_OBJS)
@echo 'Building target: $@'
$(CC) -o $@ $(MAIN_OBJS) $(FJLT_LIBS) $(KTRE_LIBS) $(LIBS)
# Rules to build the .o files
%.o: %.cpp
$(CC) $(CFLAGS) -c -o "$@" "$<" $(LIBS)
clean:
-$(RM) $(OBJS) $(EXECUTABLES)
.PHONY: all clean dependents