-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (35 loc) · 779 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
44
TIME_TEST := time_test
TSC := tsc
ABS_TIME := absTime
MOUNTAIN := mountain
STDIN := stdin
GNUPLOT := gnuplot
CFLAGS += -Wall -Wextra -g -O3
GHC := ghc
$(MOUNTAIN): CFLAGS += -mavx2
$(MOUNTAIN):
$(TIME_TEST): CFLAGS += -mavx2
$(TIME_TEST):
$(TSC):
$(STDIN):
%:: %.c
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
%.s:: CFLAGS += -S
%.s:: %.c
$(CC) $(CFLAGS) -o $@ $^
$(ABS_TIME): absTime.hs
$(GHC) -o $@ $^
run.txt: $(MOUNTAIN)
./$(MOUNTAIN) -b avx2 -t > $@
.PHONY: mountain.svg
mountain.svg: run.txt
$(GNUPLOT) splot.gnu > $@
.PHONY: all
all: $(TIME_TEST) $(TSC) $(ABS_TIME)
.PHONY: run-debug
run-debug:
STDBUF1=L STDBUF2=L DEBUG=* ./$(MOUNTAIN)
.PHONY: clean
clean:
rm -rf *.s *.o $(TIME_TEST) $(TSC) $(MOUNTAIN) $(STDIN) *.dSYM
rm -rf *.hi *.o absTime *.jpg *.png *.out