]> sjero.net Git - wget/blob - windows/Makefile.src
[svn] Various fixes by David Fritz.
[wget] / windows / Makefile.src
1 # Makefile for `wget' utility for MSVC
2 # Copyright (C) 1995, 1996, 1997, 2004 Free Software Foundation, Inc.
3
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 # In addition, as a special exception, the Free Software Foundation
19 # gives permission to link the code of its release of Wget with the
20 # OpenSSL project's "OpenSSL" library (or with modified versions of it
21 # that use the same license as the "OpenSSL" library), and distribute
22 # the linked executables.  You must obey the GNU General Public License
23 # in all respects for all of the code used other than "OpenSSL".  If you
24 # modify this file, you may extend this exception to your version of the
25 # file, but you are not obligated to do so.  If you do not wish to do
26 # so, delete this exception statement from your version.
27
28
29 # SSL (https) support requires the OpenSSL library (see http://www.openssl.org/).
30 # If you do not have OpenSSL installed or wish to build Wget without SSL
31 # support, either comment-out the following lines or define NO_SSL.
32 !ifndef NO_SSL
33 SSLDEFS = /DHAVE_SSL
34 SSLLIBS = libeay32.lib ssleay32.lib
35 SSLSRC  = gen_sslfunc.c
36 SSLOBJ  = gen_sslfunc$o
37 !endif
38
39 o = .obj
40
41 CC      = cl
42 LD      = link
43 RM      = -del
44
45 DEFS    = /DWINDOWS /D_CONSOLE /DHAVE_CONFIG_H $(SSLDEFS)
46 LIBS    = kernel32.lib advapi32.lib wsock32.lib user32.lib gdi32.lib $(SSLLIBS)
47
48 !ifdef DEBUG
49 CFLAGS  = /nologo /MTd /Od /Zi /I. $(DEFS)
50 LDFLAGS = /debug
51 !else
52 CFLAGS  = /nologo /MT /O2 /I. $(DEFS)
53 LDFLAGS = /opt:ref #/opt:nowin98
54 !endif
55
56
57 # The following enables security checks and is recommended if you are using
58 # MSVC 7.0 (or later) for 80x86.
59 !ifdef SECURITY_CHECKS
60 CFLAGS  = $(CFLAGS) /GS
61 !endif
62
63 # The following enables link-time code generation (Cross-file
64 # interprocedural optimizations).
65 !ifdef LTCG
66 CFLAGS  = $(CFLAGS) /GL
67 LDFLAGS = $(LDFLAGS) /ltcg:status
68 !endif
69
70
71 SRC = cmpt.c safe-ctype.c convert.c connect.c host.c http.c netrc.c \
72       ftp-basic.c ftp.c ftp-ls.c ftp-opie.c getopt.c hash.c \
73       html-parse.c html-url.c progress.c retr.c recur.c res.c url.c cookies.c \
74       init.c utils.c main.c version.c xmalloc.c mswindows.c \
75       gen-md5.c gnu-md5.c log.c $(SSLSRC)
76
77 OBJ = cmpt$o safe-ctype$o convert$o connect$o host$o http$o netrc$o \
78       ftp-basic$o ftp$o ftp-ls$o ftp-opie$o getopt$o hash$o \
79       html-parse$o html-url$o progress$o retr$o recur$o res$o url$o cookies$o \
80       init$o utils$o main$o version$o xmalloc$o mswindows$o \
81       gen-md5$o gnu-md5$o log$o $(SSLOBJ)
82
83 .SUFFIXES: .c .obj
84
85 # If this doesn't work for you, remove the second colon.
86 .c.obj::
87         $(CC) $(CFLAGS) /c $<
88
89 # Dependencies for building
90
91 wget.exe: $(OBJ)
92         $(LD) @<< $(LDFLAGS) /out:$@ $(OBJ) $(LIBS)
93 <<
94
95
96 #
97 # Dependencies for cleanup
98 #
99
100 clean:
101         $(RM) *.bak
102         $(RM) *.obj
103         $(RM) *.exe
104         $(RM) *.pdb
105         $(RM) *.map
106         $(RM) *.ilk
107
108 distclean: clean
109         $(RM) Makefile
110         $(RM) config.h
111
112 realclean: distclean
113         $(RM) TAGS
114
115 # Dependencies:
116
117 !include "..\windows\wget.dep"
118