forked from rbsec/sslscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.mingw
43 lines (32 loc) · 1.23 KB
/
Makefile.mingw
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
# If we're in Linux, lets see if we can find the path to Mingw automatically...
ifeq ($(shell uname), Linux)
MINGW32=$(shell which i586-mingw32msvc-gcc)
ifneq ($(MINGW32),)
CC=$(MINGW32)
endif
MINGW64=$(shell which x86_64-w64-mingw32-gcc)
ifneq ($(MINGW64),)
CC=$(MINGW64)
endif
endif
ifndef CC
CC=gcc
endif
.PHONY: clean
# Enable security options like stack protectors and variable formatting checks.
SECURITY_OPTIONS=-fstack-protector-all -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
# Turn on linker optimizations, and DEP support (--nxcompat)
LINK_OPTIONS=-Wl,-O1 -Wl,--discard-all -Wl,--no-undefined -Wl,--dynamicbase -Wl,--nxcompat -static
# Set ARCHITECTURE to either x86 or x86_64...
ARCHITECTURE=32-bit
ifeq ($(shell $(CC) -dumpmachine), x86_64-w64-mingw32)
ARCHITECTURE=64-bit
endif
# Set the version string for the program.
VERSION = "$(shell grep -E -o -m 1 "[0-9]+\.[0-9]+\.[0-9]+" Changelog) Windows $(ARCHITECTURE) (Mingw)"
all: sslscan
sslscan: sslscan.c
$(CC) -I$(OPENSSL_PATH)/include -DVERSION=\"$(VERSION)\" $(DEFINES) $(SECURITY_OPTIONS) $(LINK_OPTIONS) -o sslscan.exe sslscan.c $(OPENSSL_PATH)/libssl.a $(OPENSSL_PATH)/libcrypto.a -lws2_32 -lgdi32
strip sslscan.exe
clean:
rm -f *.o sslscan.exe