Lines 1-14
Link Here
|
1 |
--- Makefile.orig 2018-06-15 17:47:17 UTC |
1 |
--- Makefile.orig 2022-07-03 16:42:37.000000000 +0100 |
2 |
+++ Makefile |
2 |
+++ Makefile 2023-03-10 23:53:36.901042000 +0000 |
3 |
@@ -1,6 +1,6 @@ |
3 |
@@ -1,12 +1,7 @@ |
4 |
# set gcc as default if CC is not set |
4 |
# set gcc as default if CC is not set |
5 |
|
5 |
|
6 |
-GIT_VERSION = $(shell git describe --tags --always --dirty=-wip) |
6 |
-GIT_VERSION = $(shell git describe --tags --always --dirty=-wip) |
7 |
+#GIT_VERSION = $(shell git describe --tags --always --dirty=-wip) |
7 |
+VERSION = $(shell grep -E -o -m 1 "[0-9]+\.[0-9]+\.[0-9]+" Changelog) |
8 |
|
8 |
|
9 |
# Ugly hack to get version if git isn't installed |
9 |
-# Ugly hack to get version if git isn't installed |
10 |
ifeq ($(GIT_VERSION),) |
10 |
-ifeq ($(GIT_VERSION),) |
11 |
@@ -25,7 +25,7 @@ endif |
11 |
- GIT_VERSION = $(shell grep -E -o -m 1 "[0-9]+\.[0-9]+\.[0-9]+" Changelog) |
|
|
12 |
-endif |
13 |
- |
14 |
# Detect OS |
15 |
OS := $(shell uname) |
16 |
ARCH := $(shell uname -m) |
17 |
@@ -26,11 +21,11 @@ |
12 |
|
18 |
|
13 |
SRCS = sslscan.c |
19 |
SRCS = sslscan.c |
14 |
BINDIR = $(PREFIX)/bin |
20 |
BINDIR = $(PREFIX)/bin |
Lines 16-23
Link Here
|
16 |
+MANDIR = $(PREFIX)/man |
22 |
+MANDIR = $(PREFIX)/man |
17 |
MAN1DIR = $(MANDIR)/man1 |
23 |
MAN1DIR = $(MANDIR)/man1 |
18 |
|
24 |
|
19 |
WARNINGS = -Wall -Wformat=2 -Wformat-security |
25 |
WARNINGS = -Wall -Wformat=2 -Wformat-security -Wno-deprecated-declarations |
20 |
@@ -101,6 +101,9 @@ ifeq ($(OS), Darwin) |
26 |
-DEFINES = -DVERSION=\"$(GIT_VERSION)\" |
|
|
27 |
+DEFINES = -DVERSION=\"$(VERSION)\" |
28 |
|
29 |
# for dynamic linking |
30 |
LIBS = -lssl -lcrypto |
31 |
@@ -58,36 +53,12 @@ |
32 |
CFLAGS += -std=gnu11 |
33 |
|
34 |
# for static linking |
35 |
-ifeq ($(STATIC_BUILD), TRUE) |
36 |
PWD = $(shell pwd)/openssl |
37 |
LDFLAGS += -L${PWD}/ |
38 |
CFLAGS += -I${PWD}/include/ -I${PWD}/ |
39 |
-ifeq ($(OS), Darwin) |
40 |
-LIBS = ./openssl/libssl.a ./openssl/libcrypto.a -lz -lpthread |
41 |
-else |
42 |
LIBS = -lssl -lcrypto -lz -lpthread |
43 |
-endif |
44 |
-ifneq ($(OS), FreeBSD) |
45 |
- LIBS += -ldl |
46 |
-endif |
47 |
-ifeq ($(OS), SunOS) |
48 |
- LIBS += -lsocket -lnsl |
49 |
-endif |
50 |
-GIT_VERSION := $(GIT_VERSION)-static |
51 |
-else |
52 |
-# for dynamic linking |
53 |
-LDFLAGS += -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/opt/openssl/lib -L/opt/local/lib |
54 |
-CFLAGS += -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -I/usr/local/opt/openssl/include -I/opt/local/include -I/opt/local/include/openssl |
55 |
-endif |
56 |
+VERSION := $(VERSION)-static |
57 |
|
58 |
-# Find the number of processors on the system (used in -j option in building OpenSSL). |
59 |
-# Uses /usr/bin/nproc if available, otherwise defaults to 1. |
60 |
-NUM_PROCS = 1 |
61 |
-ifneq (,$(wildcard /usr/bin/nproc)) |
62 |
- NUM_PROCS = `/usr/bin/nproc --all` |
63 |
-endif |
64 |
- |
65 |
- |
66 |
.PHONY: all sslscan clean install uninstall static opensslpull |
67 |
|
68 |
all: sslscan |
69 |
@@ -114,6 +85,9 @@ |
21 |
install sslscan $(DESTDIR)$(BINDIR)/sslscan; |
70 |
install sslscan $(DESTDIR)$(BINDIR)/sslscan; |
22 |
install -d $(DESTDIR)$(MAN1DIR)/; |
71 |
install -d $(DESTDIR)$(MAN1DIR)/; |
23 |
install sslscan.1 $(DESTDIR)$(MAN1DIR)/sslscan.1; |
72 |
install sslscan.1 $(DESTDIR)$(MAN1DIR)/sslscan.1; |
Lines 27-29
Link Here
|
27 |
else |
76 |
else |
28 |
install -D sslscan $(DESTDIR)$(BINDIR)/sslscan; |
77 |
install -D sslscan $(DESTDIR)$(BINDIR)/sslscan; |
29 |
install -D sslscan.1 $(DESTDIR)$(MAN1DIR)/sslscan.1; |
78 |
install -D sslscan.1 $(DESTDIR)$(MAN1DIR)/sslscan.1; |
|
|
79 |
@@ -126,11 +100,7 @@ |
80 |
.openssl.is.fresh: opensslpull |
81 |
true |
82 |
opensslpull: |
83 |
- if [ -d openssl -a -d openssl/.git ]; then \ |
84 |
- cd ./openssl && git checkout OpenSSL_1_1_1-stable && git pull | grep -q "Already up-to-date." && [ -e ../.openssl.is.fresh ] || touch ../.openssl.is.fresh ; \ |
85 |
- else \ |
86 |
- git clone --depth 1 -b OpenSSL_1_1_1-stable https://github.com/openssl/openssl ./openssl && cd ./openssl && touch ../.openssl.is.fresh ; \ |
87 |
- fi |
88 |
+ true |
89 |
|
90 |
# Need to build OpenSSL differently on OSX |
91 |
ifeq ($(OS), Darwin) |
92 |
@@ -148,12 +118,12 @@ |
93 |
endif |
94 |
|
95 |
openssl/libcrypto.a: openssl/Makefile |
96 |
- $(MAKE) -j $(NUM_PROCS) -C openssl depend |
97 |
- $(MAKE) -j $(NUM_PROCS) -C openssl all |
98 |
-# $(MAKE) -j $(NUM_PROCS) -C openssl test # Disabled because this takes 45+ minutes for OpenSSL v1.1.1. |
99 |
+ $(MAKE) -C openssl depend |
100 |
+ $(MAKE) -C openssl all |
101 |
+# $(MAKE) -C openssl test # Disabled because this takes 45+ minutes for OpenSSL v1.1.1. |
102 |
|
103 |
static: openssl/libcrypto.a |
104 |
- $(MAKE) -j $(NUM_PROCS) sslscan STATIC_BUILD=TRUE |
105 |
+ $(MAKE) sslscan STATIC_BUILD=TRUE |
106 |
|
107 |
test: static |
108 |
./docker_test.sh |