forked from mtrojnar/osslsigncode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
67 lines (60 loc) · 1.48 KB
/
GNUmakefile
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
CHECKED_DEBUG_FLAGS:= \
-ggdb \
-g3 \
-O2 \
-pedantic \
-Wall \
-Wextra \
-Wno-long-long \
-Wconversion \
-D_FORTIFY_SOURCE=2 \
-Wformat=2 \
-Wredundant-decls \
-Wcast-qual \
-Wnull-dereference \
-Wno-deprecated-declarations \
-Wmissing-declarations \
-Wmissing-prototypes \
-Wmissing-noreturn \
-Wmissing-braces \
-Wparentheses \
-Wstrict-aliasing=3 \
-Wstrict-overflow=2 \
-Wlogical-op \
-Wwrite-strings \
-Wcast-align=strict \
-Wdisabled-optimization \
-Wshift-overflow=2 \
-Wundef \
-Wshadow \
-Wmisleading-indentation \
-Wabsolute-value \
-Wunused-parameter \
-Wunused-function
# check_c_compiler_flag("-fstack-protector-all" HAVE_STACK_PROTECTOR_ALL)
# target_compile_options(${target} PRIVATE -fPIE)
# target_link_options(${target} PRIVATE -fPIE -pie)
# target_link_options(${target} PRIVATE -Wl,-z,relro)
# target_link_options(${target} PRIVATE -Wl,-z,now)
# target_link_options(${target} PRIVATE -Wl,-z,noexecstack)
CC:=gcc
LDLIBS:=-lz -lcurl -lcrypto -lssl -ldl
LDFLAGS:=-pthread
CFLAGS:=$(CHECKED_DEBUG_FLAGS) -fstack-protector-all
CPPFLAGS:=-DHAVE_SYS_MMAN_H -DENABLE_CURL
all: osslsigncode
SOURCES:=$(filter-out applink%,$(wildcard *.c))
OBJDIR:=./obj
OBJECTS:=$(addprefix $(OBJDIR)/,$(SOURCES:.c=.o))
$(OBJECTS): $(OBJDIR)
osslsigncode: $(OBJECTS)
$(LINK.c) $^ $(LOADLIBES) $(LDLIBS) -o $@
$(OBJDIR)::
mkdir $(OBJDIR)
obj/%.o: %.c
$(COMPILE.c) $(OUTPUT_OPTION) $<
clean:
-rm -rf $(OBJDIR)
rebuild: clean all
.NOTPARALLEL: rebuild
.PHONY: all clean rebuild