Skip to content

Commit b5b2e0a

Browse files
committed
openwcom.mak: fix build with internal zlib
Signed-off-by: KO Myung-Hun <[email protected]>
1 parent 6ffcc5d commit b5b2e0a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Mkfiles/openwcom.mak

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
# cross-compile on a DOS/Win32/OS2 platform host
55
#
66

7+
.DEFAULT : what
8+
79
top_srcdir = .
810
srcdir = .
9-
VPATH = $(srcdir)\asm;$(srcdir)\x86;asm;x86;$(srcdir)\macros;macros;$(srcdir)\output;$(srcdir)\lib;$(srcdir)\common;$(srcdir)\stdlib;$(srcdir)\nasmlib;$(srcdir)\disasm
11+
VPATH = $(srcdir)\asm;$(srcdir)\x86;asm;x86;$(srcdir)\macros;macros;$(srcdir)\output;$(srcdir)\lib;$(srcdir)\common;$(srcdir)\stdlib;$(srcdir)\nasmlib;$(srcdir)\disasm;$(srcdir)\zlib
1012
prefix = C:\Program Files\NASM
1113
exec_prefix = $(prefix)
1214
bindir = $(prefix)\bin
@@ -16,7 +18,7 @@ CC = *wcl386
1618
DEBUG =
1719
CFLAGS = -zq -6 -ox -wx -wcd=124 -ze -fpi $(DEBUG)
1820
BUILD_CFLAGS = $(CFLAGS) $(%TARGET_CFLAGS)
19-
INTERNAL_CFLAGS = -I$(srcdir) -I. -I$(srcdir)\include -I$(srcdir)\x86 -Ix86 -I$(srcdir)\asm -Iasm -I$(srcdir)\disasm -I$(srcdir)\output
21+
INTERNAL_CFLAGS = -I$(srcdir) -I. -I$(srcdir)\include -I$(srcdir)\x86 -Ix86 -I$(srcdir)\asm -Iasm -I$(srcdir)\disasm -I$(srcdir)\output -I$(srcdir)\zlib
2022
ALL_CFLAGS = $(BUILD_CFLAGS) $(INTERNAL_CFLAGS)
2123
LD = *wlink
2224
LDEBUG =
@@ -149,15 +151,23 @@ LIBOBJ_DIS = &
149151

150152
# Objects for the local copy of zlib. The variable ZLIB is set to
151153
# $(ZLIBOBJ) if the internal version of zlib should be used.
154+
# zlib\crc32.obj is renamed to zlib\z_crc32.obj to avoid conflicts with
155+
# nasmlib\crc32.obj.
152156
ZLIBOBJ = &
153157
zlib\adler32.obj &
154-
zlib\crc32.obj &
158+
zlib\z_crc32.obj &
155159
zlib\infback.obj &
156160
zlib\inffast.obj &
157161
zlib\inflate.obj &
158162
zlib\inftrees.obj &
159163
zlib\zutil.obj
160164

165+
# Special rule to avoid conflicts with nasmlib\crc32.obj because of stupid
166+
# behavior of implicit rules and VPATH of Open Watcom Make.
167+
zlib\z_crc32.obj : zlib\crc32.c
168+
@set INCLUDE=
169+
$(CC) -c $(ALL_CFLAGS) -fo=$^@ $[@
170+
161171
LIBOBJ = $(LIBOBJ_W) $(LIBOBJ_NW) $(ZLIB)
162172
ALLOBJ_W = $(NASM) $(LIBOBJ_W)
163173
ALLOBJ = $(PROGOBJ) $(LIBOBJ)

0 commit comments

Comments
 (0)