Skip to content

Commit

Permalink
Update makefile to build in Msys2 mingw64. Fixes #308
Browse files Browse the repository at this point in the history
  • Loading branch information
rbsec committed Mar 18, 2024
1 parent 7b44bd6 commit 2b567cb
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ DEFINES = -DVERSION=\"$(GIT_VERSION)\"
# for dynamic linking
LIBS = -lssl -lcrypto
ifneq ($(OS), FreeBSD)
ifneq ($(findstring MINGW64,$(OS)),MINGW64)
LIBS += -ldl
else
LIBS += -lwsock32 -lWs2_32
endif
endif
ifeq ($(OS), SunOS)
CFLAGS += -m64
Expand All @@ -51,7 +55,11 @@ CFLAGS += -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE
ifneq ($(OS), Darwin)
ifneq ($(OS), SunOS)
ifneq ($(findstring CYGWIN,$(OS)),CYGWIN)
ifneq ($(findstring MINGW64,$(OS)),MINGW64)
LDFLAGS += -pie -z relro -z now
else
LDFLAGS += -pie
endif
endif
endif
endif
Expand All @@ -70,8 +78,10 @@ else
LIBS = -lssl -lcrypto -lz -lpthread
endif
ifneq ($(OS), FreeBSD)
ifneq ($(findstring CYGWIN,$(OS)),CYGWIN)
LIBS += -ldl
endif
endif
ifeq ($(OS), SunOS)
LIBS += -lsocket -lnsl
endif
Expand Down

0 comments on commit 2b567cb

Please sign in to comment.