-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (30 loc) · 1.06 KB
/
Copy pathMakefile
File metadata and controls
40 lines (30 loc) · 1.06 KB
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
CC = gcc
CFLAGS = -O3 -march=native -Wall
LDFLAGS = -lm
# OpenMP support (platform-detected)
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
OMP_CFLAGS = -Xclang -fopenmp -I/opt/homebrew/opt/libomp/include
OMP_LDFLAGS = -L/opt/homebrew/opt/libomp/lib -lomp
else
OMP_CFLAGS = -fopenmp
OMP_LDFLAGS = -fopenmp
endif
LIB_SRC = lib/sha256.c lib/scan.c
LIB_OBJ = $(LIB_SRC:.c=.o)
# --- Library ---
lib/%.o: lib/%.c lib/%.h
$(CC) $(CFLAGS) -c $< -o $@
# --- Tools ---
.PHONY: all clean
all: fast_scan golden_scanner kernel_sweep sa_search
fast_scan: q1_barrier_location/homotopy/fast_scan.c $(LIB_OBJ)
$(CC) $(CFLAGS) -Ilib $< $(LIB_OBJ) $(LDFLAGS) -o $@
golden_scanner: q3_candidate_families/golden_scanner.c
$(CC) $(CFLAGS) $(OMP_CFLAGS) $< $(LDFLAGS) $(OMP_LDFLAGS) -o $@
kernel_sweep: q3_candidate_families/kernel_sweep.c
$(CC) $(CFLAGS) $(OMP_CFLAGS) $< $(LDFLAGS) $(OMP_LDFLAGS) -o $@
sa_search: 79_sa_collision_search.c
$(CC) $(CFLAGS) $(OMP_CFLAGS) $< $(LDFLAGS) $(OMP_LDFLAGS) -o $@
clean:
rm -f $(LIB_OBJ) fast_scan golden_scanner kernel_sweep sa_search