]> sjero.net Git - wget/blob - windows/Makefile.watcom
[svn] Another Watcom update by Csaba Raduly.
[wget] / windows / Makefile.watcom
1 ## Compiler, linker, and lib stuff
2 ## Makefile for use with watcom win95/winnt executable.
3 #
4 # Copy this file to the ..\src directory (maybe rename to Makefile).
5 #
6
7 CC=wcc386 /zq
8 LINK=wlink
9
10 .BEFORE
11         @SET INCLUDE=$(%WATCOM)\h;$(%WATCOM)\h\nt;.
12
13 LFLAGS=op q sys nt op st=32767 op vers=1.7 op map op de 'GNU wget 1.7dev' de dw op symf
14 #
15 # op q              : quiet !
16 # sys nt            : producing an NT app
17 # op st(ack)=32768  : stack size
18 # op vers(ion)=1.7  : "Image version" in the EXE header ( major.minor )
19 # op map            : produce a map file
20 # op de             : textual description, placed in the executable
21 # de dw             : debug info on Dwarf format
22 # op symf           : place debug info in a separate wget.sym
23 #
24
25 CFLAGS=/zp4 /w4 /fpd /5s /fp5 /bm /mf /bt=nt /DWINDOWS /DHAVE_CONFIG_H
26 #                    ^^^^^^^^ wget will run on NT. We can safely assume a Pentium :-)
27 # /zp4= pack structure members with this alignment
28 # /d1 = line number debug info
29 # /w4 = warning level
30 # /fpd= ??? no such switch !
31 # /5s = Pentium stack-based calling
32 # /fp5= Pentium floating point
33 # /bm = build multi-threaded
34 # /mf = flat memory model
35 # /bt = "build target" (nt)
36
37 #
38 # Choose one of the following three:
39 # /od /d2  for no optimization, full debug info
40 # /os /d2  to optimize for size, full debug info (or /d1 for line number debug info)
41 # /othexan for "heavy-duty" optimizations, no debug info
42 #
43 #CFLAGS+= /od /d2
44 CFLAGS+= /os /d2
45 #CFLAGS+= /othexan
46 #       ^^-- mind the gap !!
47
48 #CFLAGS+= /DDEBUG_MALLOC
49 #       ^^-- mind the gap !!
50
51 #
52 # The trouble: dependencies need to be space-separated (exe : obj1 obj2)
53 #              wlink wants them comma-separated ( wlink FILE obj1,obj2 )
54 # The trick  : Use wmake's "immediate expansion" feautre ( $+ turns it on, 
55 #              end-of-line and $_ turns it off ) to construct 
56 # Background : wmake expands macros in macro definitions at the place of
57 #              the macro call (GNU make's = behaviour)
58 #              $+ changes this behaviour to expand the macros at the 
59 #              place of the macro *definition* (kinda like gmake's := does)
60 #
61 # See the "Macros" topic in the Watcom Tools Guide
62 #
63
64 #
65 # Add new object files to OBJS, with $_ appended
66 # Note: There MUST NOT be a $_ on the last one !!
67 #       & is the line continuation character (also shouldn't be present at the end)
68 #
69 OBJS = cmpt.obj$_ connect.obj$_ cookies.obj$_ fnmatch.obj$_ ftp.obj$_ ftp-basic.obj$_  &
70       ftp-ls.obj$_ ftp-opie.obj$_ getopt.obj$_ hash.obj$_ headers.obj$_ host.obj$_ html-parse.obj$_ html-url.obj$_  &
71       http.obj$_ init.obj$_ log.obj$_ main.obj$_ md5.obj$_ netrc.obj$_ rbuf.obj$_  &
72       recur.obj$_ retr.obj$_ safe-ctype.obj$_ url.obj$_ utils.obj$_ version.obj$_ mswindows.obj
73
74
75 #
76 # For LINKOBJS, $_ is defined as a comma
77 #
78 _=,
79 LINKOBJS=FILE $+$(OBJS)$-
80
81 #
82 # Empty $_ again. OBJS can now be used as the dependency list for wget.exe
83 #
84 _=
85
86
87
88 LIBFILES = 
89 #
90 # Add extra libs like this :
91 #LIBFILES = LIBF lz32.lib,gdi32.lib
92
93 BINNAME=wget.exe
94
95 all : config.h $(BINNAME) .SYMBOLIC
96
97 #
98 # We use config.h.ms
99 #
100 config.h : ..\windows\config.h.ms
101         copy $[@ $^@
102
103 $(BINNAME): $(OBJS) Makefile
104         $(LINK) $(LFLAGS) NAME $(BINNAME) $(LINKOBJS) $(LIBPATH) $(LIBFILES)
105
106
107 #
108 # Explicit dependencies not needed because Watcom C stores
109 # dependency information in the object file. Wmake can read this information
110 # if prompted by .AUTODEPEND
111 #
112
113 .c.obj: .AUTODEPEND
114         $(CC) $(CFLAGS) $[@
115