Skip to content

Commit

Permalink
Adjust Makefile for non-gnu OSes
Browse files Browse the repository at this point in the history
Let Makefile to use CC variable to chose compiler conveniently.
Rename current CFLAGS to CPPFLAGS.

Also we need to pass '-pthread' option on OpenBSD. The option
is carried in CFLAGS now.

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from #188)
  • Loading branch information
Sashan authored and levitte committed Apr 17, 2024
1 parent 8a57945 commit 50849d4
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions perf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,34 @@ clean:

#-Wl,-rpath,$(TARGET_OSSL_LIBRARY_PATH)

CFLAGS += -I$(TARGET_OSSL_INCLUDE_PATH) -I.
CPPFLAGS += -I$(TARGET_OSSL_INCLUDE_PATH) -I.
CFLAGS += -pthread
LDFLAGS += -L$(TARGET_OSSL_LIBRARY_PATH) -L.

libperf.a: perflib/*.c perflib/*.h
gcc $(CFLAGS) -c perflib/*.c
$(CC) $(CPPFLAGS) $(CFLAGS) -c perflib/*.c
ar rcs libperf.a *.o

randbytes: randbytes.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o randbytes randbytes.c -lperf -lcrypto
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o randbytes randbytes.c -lperf -lcrypto

handshake: handshake.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o handshake handshake.c -lperf -lcrypto -lssl
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o handshake handshake.c -lperf -lcrypto -lssl

sslnew: sslnew.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o sslnew sslnew.c -lperf -lcrypto -lssl
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o sslnew sslnew.c -lperf -lcrypto -lssl

newrawkey: newrawkey.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o newrawkey newrawkey.c -lperf -lcrypto
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o newrawkey newrawkey.c -lperf -lcrypto

rsasign: rsasign.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o rsasign rsasign.c -lperf -lcrypto
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o rsasign rsasign.c -lperf -lcrypto

x509storeissuer: x509storeissuer.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o x509storeissuer x509storeissuer.c -lperf -lcrypto
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o x509storeissuer x509storeissuer.c -lperf -lcrypto

providerdoall: providerdoall.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o providerdoall providerdoall.c -lperf -lcrypto
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o providerdoall providerdoall.c -lperf -lcrypto

pemread: pemread.c libperf.a
gcc $(CFLAGS) $(LDFLAGS) -o pemread pemread.c -lperf -lcrypto
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o pemread pemread.c -lperf -lcrypto

0 comments on commit 50849d4

Please sign in to comment.