wget/windows/Makefile.watcom

116 lines
3.3 KiB
Makefile

## Compiler, linker, and lib stuff
## Makefile for use with watcom win95/winnt executable.
#
# Copy this file to the ..\src directory (maybe rename to Makefile).
#
CC=wcc386 /zq
LINK=wlink
.BEFORE
@SET INCLUDE=$(%WATCOM)\h;$(%WATCOM)\h\nt;.
LFLAGS=op q sys nt op st=32767 op vers=1.7 op map op de 'GNU wget 1.7dev' de dw op symf
#
# op q : quiet !
# sys nt : producing an NT app
# op st(ack)=32768 : stack size
# op vers(ion)=1.7 : "Image version" in the EXE header ( major.minor )
# op map : produce a map file
# op de : textual description, placed in the executable
# de dw : debug info on Dwarf format
# op symf : place debug info in a separate wget.sym
#
CFLAGS=/zp4 /w4 /fpd /5s /fp5 /bm /mf /bt=nt /DWINDOWS /DHAVE_CONFIG_H
# ^^^^^^^^ wget will run on NT. We can safely assume a Pentium :-)
# /zp4= pack structure members with this alignment
# /d1 = line number debug info
# /w4 = warning level
# /fpd= ??? no such switch !
# /5s = Pentium stack-based calling
# /fp5= Pentium floating point
# /bm = build multi-threaded
# /mf = flat memory model
# /bt = "build target" (nt)
#
# Choose one of the following three:
# /od /d2 for no optimization, full debug info
# /os /d2 to optimize for size, full debug info (or /d1 for line number debug info)
# /othexan for "heavy-duty" optimizations, no debug info
#
#CFLAGS+= /od /d2
CFLAGS+= /os /d2
#CFLAGS+= /othexan
# ^^-- mind the gap !!
#CFLAGS+= /DDEBUG_MALLOC
# ^^-- mind the gap !!
#
# The trouble: dependencies need to be space-separated (exe : obj1 obj2)
# wlink wants them comma-separated ( wlink FILE obj1,obj2 )
# The trick : Use wmake's "immediate expansion" feautre ( $+ turns it on,
# end-of-line and $_ turns it off ) to construct
# Background : wmake expands macros in macro definitions at the place of
# the macro call (GNU make's = behaviour)
# $+ changes this behaviour to expand the macros at the
# place of the macro *definition* (kinda like gmake's := does)
#
# See the "Macros" topic in the Watcom Tools Guide
#
#
# Add new object files to OBJS, with $_ appended
# Note: There MUST NOT be a $_ on the last one !!
# & is the line continuation character (also shouldn't be present at the end)
#
OBJS = cmpt.obj$_ connect.obj$_ cookies.obj$_ fnmatch.obj$_ ftp.obj$_ ftp-basic.obj$_ &
ftp-ls.obj$_ ftp-opie.obj$_ getopt.obj$_ hash.obj$_ headers.obj$_ host.obj$_ html-parse.obj$_ html-url.obj$_ &
http.obj$_ init.obj$_ log.obj$_ main.obj$_ md5.obj$_ netrc.obj$_ rbuf.obj$_ &
recur.obj$_ retr.obj$_ safe-ctype.obj$_ url.obj$_ utils.obj$_ version.obj$_ mswindows.obj
#
# For LINKOBJS, $_ is defined as a comma
#
_=,
LINKOBJS=FILE $+$(OBJS)$-
#
# Empty $_ again. OBJS can now be used as the dependency list for wget.exe
#
_=
LIBFILES =
#
# Add extra libs like this :
#LIBFILES = LIBF lz32.lib,gdi32.lib
BINNAME=wget.exe
all : config.h $(BINNAME) .SYMBOLIC
#
# We use config.h.ms
#
config.h : ..\windows\config.h.ms
copy $[@ $^@
$(BINNAME): $(OBJS) Makefile
$(LINK) $(LFLAGS) NAME $(BINNAME) $(LINKOBJS) $(LIBPATH) $(LIBFILES)
#
# Explicit dependencies not needed because Watcom C stores
# dependency information in the object file. Wmake can read this information
# if prompted by .AUTODEPEND
#
.c.obj: .AUTODEPEND
$(CC) $(CFLAGS) $[@