Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion win32/Makefile.msc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
# Usage:
# nmake -f win32/Makefile.msc (standard build)
# nmake -f win32/Makefile.msc LOC=-DFOO (nonstandard build)
#
# On ARM64 Windows, using the ARCH=arm64 option is required to ensure the build does not fail.

# The toplevel directory of the source tree.
#
TOP = .

# optional build flags
LOC =
ARCH =

# variables
STATICLIB = zlib.lib
Expand All @@ -33,6 +36,12 @@ OBJS = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzre
gzwrite.obj infback.obj inflate.obj inftrees.obj inffast.obj trees.obj uncompr.obj zutil.obj
OBJA =

# arch dependent variables
!IF "$(ARCH)" == "arm64"
SHAREDLIBBASE =
!ELSE
SHAREDLIBBASE = -base:0x5A4C0000
!ENDIF

# targets
all: $(STATICLIB) $(SHAREDLIB) $(IMPLIB) \
Expand All @@ -45,7 +54,7 @@ $(IMPLIB): $(SHAREDLIB)

$(SHAREDLIB): $(TOP)/win32/zlib.def $(OBJS) $(OBJA) zlib1.res
$(LD) $(LDFLAGS) -def:$(TOP)/win32/zlib.def -dll -implib:$(IMPLIB) \
-out:$@ -base:0x5A4C0000 $(OBJS) $(OBJA) zlib1.res
-out:$@ $(SHAREDLIBBASE) $(OBJS) $(OBJA) zlib1.res
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;2

Expand Down