-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (33 loc) · 797 Bytes
/
Makefile
File metadata and controls
46 lines (33 loc) · 797 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
CC=gcc
CFLAGS=-Wall -std=c99 -g -O2 -I./include
LDFLAGS=
OBJDIR=./obj
BINDIR=./bin
SRCDIR=./src
TESTDIR=./test
INCDIR=./include
OBJS=$(OBJDIR)/gift_generate.o $(OBJDIR)/gift_utils.o \
$(OBJDIR)/gift_key_schedule.o \
$(OBJDIR)/gift_core.o \
$(OBJDIR)/main.o
TARGET=$(BINDIR)/a.out
.PHONY: all clean dir rebuild
all: dir $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $@ $^
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -MMD -MP -c $< -o $@
-include $(OBJS:.o=.d)
clean:
rm -f $(OBJS) $(TARGET) $(OBJDIR)/*.d
dir:
@mkdir -p $(OBJDIR) $(BINDIR)
rebuild: clean all
run:
(cd bin && ./a.out)
leak:
(cd bin && valgrind --leak-check=full --show-leak-kinds=all ./a.out)
comp:
(cd bin && ./a.out > speed.txt)
(cd bin && mv speed.txt ../view/)
(cd view && python3 compare_cycle.py)