1 # Makefile for `wget' utility
2 # Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
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.
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.
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.
24 top_srcdir = @top_srcdir@
31 exec_prefix = @exec_prefix@
33 sysconfdir = @sysconfdir@
34 localedir = $(prefix)/share/locale
38 # The following line is losing on some versions of make!
39 DEFS = @DEFS@ -DSYSTEM_WGETRC=\"$(sysconfdir)/wgetrc\" -DLOCALEDIR=\"$(localedir)\"
45 INCLUDES = -I. -I$(srcdir)
47 COMPILE = $(CC) $(INCLUDES) $(CPPFLAGS) $(DEFS) $(CFLAGS)
48 LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
50 INSTALL_PROGRAM = @INSTALL_PROGRAM@
54 # Conditional compiles
60 OBJ = $(ALLOCA) cmpt$o connect$o fnmatch$o ftp$o ftp-basic$o \
61 ftp-ls$o $(OPIE_OBJ) ftpparse$o getopt$o hash$o \
62 headers$o host$o html-parse$o html-url$o http$o init$o \
63 log$o main$o $(MD5_OBJ) netrc$o rbuf$o recur$o retr$o \
64 snprintf$o $(SSL_OBJ) url$o utils$o version$o
67 .SUFFIXES: .c .o ._c ._o
73 $(ANSI2KNR) $< > $*.tmp && mv $*.tmp $@
76 @echo $(COMPILE) -c $<
78 @ln $< _$*.c && $(COMPILE) -c _$*.c && mv _$*.o $@ && rm _$*.c
81 $(ANSI2KNR) $< > $*.tmp && mv $*.tmp $*._c
82 @echo $(COMPILE) -c $*._c
84 @ln $*._c _$*.c && $(COMPILE) -c _$*.c && mv _$*.o $@ && rm _$*.c
86 # Dependencies for building
89 $(LINK) $(OBJ) $(LIBS)
92 $(CC) -o ansi2knr ansi2knr.o $(LIBS)
97 # Dependencies for installing
102 uninstall: uninstall.bin
104 install.bin: wget$(exeext)
105 $(top_srcdir)/mkinstalldirs $(bindir)
106 $(INSTALL_PROGRAM) wget$(exeext) $(bindir)/wget$(exeext)
109 $(RM) $(bindir)/wget$(exeext)
112 # Dependencies for cleanup
116 $(RM) *.o wget$(exeext) *~ *.bak core $(ANSI2KNR) *._o *._c
119 $(RM) Makefile config.h
125 # Dependencies for maintenance
130 Makefile: Makefile.in ../config.status
131 cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status
136 # DO NOT DELETE THIS LINE -- make depend depends on it.
139 connect$o: wget.h connect.h host.h
140 fnmatch$o: wget.h fnmatch.h
141 ftp-basic$o: wget.h utils.h rbuf.h connect.h host.h
142 ftp-ls$o: wget.h utils.h ftp.h url.h ftpparse.h
143 ftp-opie$o: wget.h md5.h
144 ftp$o: wget.h utils.h url.h rbuf.h retr.h ftp.h connect.h host.h fnmatch.h netrc.h
145 ftpparse$o: ftpparse.h
146 getopt$o: wget.h getopt.h
147 hash$o: wget.h utils.h hash.h
148 headers$o: wget.h connect.h rbuf.h headers.h
149 host$o: wget.h utils.h host.h url.h hash.h
150 html-parse$o: wget.h html-parse.h
151 html-url$o: wget.h html-parse.h url.h utils.h
152 html$o: wget.h url.h utils.h ftp.h
153 http$o: wget.h utils.h url.h host.h rbuf.h retr.h headers.h connect.h fnmatch.h netrc.h md5.h
154 init$o: wget.h utils.h init.h host.h recur.h netrc.h
155 log$o: wget.h utils.h
156 main$o: wget.h utils.h getopt.h init.h retr.h recur.h host.h
158 mswindows$o: wget.h url.h
159 netrc$o: wget.h utils.h netrc.h init.h
160 rbuf$o: wget.h rbuf.h connect.h
161 recur$o: wget.h url.h recur.h utils.h retr.h ftp.h fnmatch.h host.h hash.h
162 retr$o: wget.h utils.h retr.h url.h recur.h ftp.h host.h connect.h hash.h
164 url$o: wget.h utils.h url.h host.h
165 utils$o: wget.h utils.h fnmatch.h hash.h