-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·49 lines (37 loc) · 795 Bytes
/
Makefile
File metadata and controls
executable file
·49 lines (37 loc) · 795 Bytes
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
49
# Makefile for Coursework Part 2
#
# C compiler and options for Intel
#
CC= icc -O3 -qopenmp -std=c99
LIB= -lm
#
# C compiler and options for GNU
#
#CC= gcc -O3 -fopenmp -std=c99
#LIB= -lm
#
# Object files
#
OBJ1= bin/solver1.o bin/function.o
OBJ2= bin/solver2_shared.o bin/function.o
OBJ3= bin/solver2_separate.o bin/function.o
#
# Compile
#
all: bin/solver1 bin/solver2_shared bin/solver2_separate
bin:
mkdir -p bin
bin/solver1: $(OBJ1)
$(CC) -o $@ $(OBJ1) $(LIB)
bin/solver2_shared: $(OBJ2)
$(CC) -o $@ $(OBJ2) $(LIB)
bin/solver2_separate: $(OBJ3)
$(CC) -o $@ $(OBJ3) $(LIB)
bin/%.o: src/%.c | bin
$(CC) -c $< -o $@
#
# Clean out object files and the executable.
#
clean:
rm bin/*.o bin/solver1 bin/solver2_shared bin/solver2_separate
rm -rf bin/