-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (35 loc) · 999 Bytes
/
Copy pathMakefile
File metadata and controls
49 lines (35 loc) · 999 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
.PHONY: build start debug test plot
CC := gcc
CFLAGS := -std=c99 -Wall -O2 -Iinclude
LDFLAGS := -lm
OUT := bin
EXEC := $(OUT)/hw2
OBJS := src/hw2.o \
src/frame.o \
src/search.o \
src/algorithms/no_search.o \
src/algorithms/three_step_search.o \
src/algorithms/orthogonal_search.o \
src/algorithms/gradient_descent_search.o \
src/algorithms/cross_search.o \
src/algorithms/hexagon_search.o
src/%.o: src/%.c include/%.h
$(CC) $(CFLAGS) -o $@ -c $<
src/algorithms/%.o: src/algorithms/%.c
$(CC) $(CFLAGS) -o $@ -c $<
$(EXEC): $(OBJS)
mkdir -p $(OUT)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
all: $(EXEC)
INPUT := data/Foreman.CIF
FORMAT := CIF
SEARCH := hexagon
build: $(EXEC)
start: $(EXEC)
./$(EXEC) $(INPUT) -f $(FORMAT) -s $(SEARCH)
debug: $(EXEC)
gdb -nh -x $$XDG_CONFIG_HOME/gdb/init $(EXEC)
test: $(EXEC)
@time ./$(EXEC) $(INPUT) -f $(FORMAT) -s $(SEARCH) > result.log
plot: $(EXEC) doc/plot/gnuplot.gpi
time fish doc/plot/plot.fish data