-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
48 lines (34 loc) · 1.07 KB
/
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
45
46
47
48
BIN_DIR := ./bin
TARGET := $(BIN_DIR)/ctr_drbg
SRC_DIR := src
C_SRCS := $(SRC_DIR)/aes.c $(SRC_DIR)/ctr_drbg.c $(SRC_DIR)/main.c $(SRC_DIR)/test_utilities.c
S_SRCS := $(SRC_DIR)/vaes256_key_expansion.S
COMP_FILES := $(C_SRCS) $(S_SRCS)
# Platform flags
CFLAGS := -m64 -maes -mavx2 -msse2 -O3 -std=c99
# For debug
CFLAGS += -ggdb
# Warnings flags
CFLAGS += -Wno-missing-braces -Wno-missing-field-initializers -Wall -Werror -Wpedantic
CFLAGS += -mno-red-zone -fvisibility=hidden -funsigned-char -Wall -Wextra -Werror -Wpedantic
CFLAGS += -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow
CFLAGS += -Wcast-align -Wwrite-strings -Wno-deprecated-declarations -Wno-unknown-pragmas -Wformat-security
CFLAGS += -Wcast-qual
ifdef PERF
CFLAGS += -DPERF
endif
ifdef COUNT_INSTRUCTIONS
CFLAGS += -DCOUNT_INSTRUCTIONS -DPERF
endif
ifdef VAES
CFLAGS += -mavx512f -mavx512dq -mavx512bw -mvaes -DVAES
endif
INC := -I.
CC ?= gcc
.PHONY: $(BIN_DIR)
all: $(BIN_DIR)
$(CC) $(COMP_FILES) $(CFLAGS) $(INC) -o $(TARGET)
$(BIN_DIR):
mkdir -p $(BIN_DIR)
clean:
rm -rf $(BIN_DIR)