1 # Makefile for popclient
3 # Ultrix 2.2 make doesn't expand the value of VPATH.
16 # How to invoke ranlib. This is only used by the `glob' subdirectory.
19 # NeXT 1.0a uses an old version of GCC, which required -D__inline=inline.
20 # See also `config.h'.
23 # If your system needs extra libraries loaded in, define them here.
24 LOADLIBS = @LIBS@ @LEXLIB@
26 # Any extra object files your system needs.
29 # Extra sources/objects for library functions not provided on the host system.
33 # Common prefix for machine-independent installed files.
35 # Common prefix for machine-dependent installed files.
36 exec_prefix = $(prefix)
38 # Name under which to install popclient
40 # Directory in which to install.
41 bindir = $(exec_prefix)/bin
42 # Directory to install the Info files in.
43 infodir = $(prefix)/info
44 # Directory to install the man page in.
45 mandir = $(prefix)/man/man$(manext)
46 # Number to put on the man page filename.
49 # Program to install `make'.
50 INSTALL_PROGRAM = @INSTALL_PROGRAM@
51 # Program to install the man page.
52 INSTALL_DATA = @INSTALL_DATA@
53 # Generic install program.
56 # Program to format Texinfo source into Info files.
58 # Program to format Texinfo source into DVI files.
61 # Programs to make tags files.
65 popobjs = socket.o getpass.o pop2.o pop3.o imap.o popclient.o options.o \
66 poprc_l.o poprc_y.o poprc.o daemon.o driver.o xmalloc.o
68 objs = $(popobjs) $(EXTRAOBJ) $(extras)
70 srcs = $(srcdir)/socket.c $(srcdir)/getpass.c $(srcdir)/pop2.c \
71 $(srcdir)/pop3.c $(srcdir)/imap.c $(srcdir)/popclient.c \
72 $(srcdir)/options.c $(srcdir)/poprc.c $(srcdir)/daemon.c \
73 $(srcdir)/driver.c $(srcdir)/xmalloc.c $(EXTRASRC)
76 .SUFFIXES: .o .c .h .y .l .ps .dvi .info .texi
81 test -f config.h || touch config.h
82 test -f poprc_y.h || touch poprc_y.h
83 makedepend -fMakefile.in *.c
85 # Some makes apparently use .PHONY as the default goal is it is before `all'.
88 $(popobjs): popclient.h
90 popclient: $(srcdir)/poprc_l.c $(srcdir)/poprc_y.c $(objs)
91 $(CC) $(LDFLAGS) $(objs) $(LOADLIBS) -o popclient
94 # -I. is needed to find config.h in the build directory.
96 $(CC) $(defines) -c -I. -I$(srcdir) $(CFLAGS) $< $(OUTPUT_OPTION)
102 $(LEX) $(LEXFLAGS) $<
109 $(YACC) $(YACCFLAGS) $<
113 # For some losing Unix makes.
119 tagsrcs = $(srcs) $(srcdir)/poprc_l.c $(srcdir)/poprc_y.c
125 .PHONY: install installdirs
126 install: installdirs \
127 $(bindir)/$(instname) # $(infodir)/popclient.info \
128 $(mandir)/$(instname).$(manext)
131 $(SHELL) ${srcdir}/mkinstalldirs $(bindir) $(infodir) $(mandir)
133 $(bindir)/$(instname): popclient
134 $(INSTALL_PROGRAM) popclient $@
136 $(infodir)/popclient.info: popclient.info
137 if [ -r ./popclient.info ]; then dir=.; else dir=$(srcdir); fi; \
138 for file in $${dir}/popclient.info*; do \
139 name="`basename $$file`"; \
140 $(INSTALL_DATA) $$file \
141 `echo $@ | sed "s,popclient.info\$$,$$name,"`; \
143 # Run install-info only if it exists.
144 # Use `if' instead of just prepending `-' to the
145 # line so we notice real errors from install-info.
146 # We use `$(SHELL) -c' because some shells do not
147 # fail gracefully when there is an unknown command.
148 if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
149 install-info --infodir=$(infodir) $$dir/popclient.info; \
152 $(mandir)/$(instname).$(manext): popclient.man
153 $(INSTALL_DATA) $(srcdir)/popclient.man $@
156 .PHONY: clean realclean distclean mostlyclean
158 -rm -f popclient *.o core popclient.dvi \
159 poprc_l.c poprc_y.h poprc_y.c popclient.tar popclient.tar.gz
162 -rm -f Makefile config.h
163 -rm -f config.cache config.status config.log stamp-config
165 -rm -f popclient.log popclient.toc popclient.*aux
167 realclean: popclient.info* distclean
171 Makefile: config.status $(srcdir)/Makefile.in
172 $(SHELL) config.status
174 config.h: stamp-config
176 stamp-config: config.status $(srcdir)/config.h.in
177 $(SHELL) config.status
180 configure: configure.in
183 # This tells versions [3.59,3.63) of GNU make not to export all variables.
187 # Special dependencies, not easily handled without explicit rules
188 $(srcdir)/poprc_l.c: $(srcdir)/poprc_l.l
189 $(srcdir)/poprc_y.c: $(srcdir)/poprc_y.y
191 parser = $(srcdir)/poprc_l.l $(srcdir)/poprc_y.y
192 headers = $(srcdir)/popclient.h $(srcdir)/socket.h $(srcdir)/poproto.h
193 extra = $(srcdir)/alloca.c $(srcdir)/bzero.[ch] $(srcdir)/errorcodes \
194 $(srcdir)/getopt.[ch] $(srcdir)/getopt1.c $(srcdir)/md5*.[ch] \
195 $(srcdir)/strcasecmp.c $(srcdir)/strdup.c
196 docs = $(srcdir)/COPYING $(srcdir)/README $(srcdir)/INSTALL $(srcdir)/NEWS \
197 $(srcdir)/popclient.lsm $(srcdir)/RFC/*.txt \
198 $(srcdir)/*.man $(srcdir)/sample.poprc
199 config = $(srcdir)/Makefile.in $(srcdir)/configure.in $(srcdir)/configure \
200 $(srcdir)/config.guess $(srcdir)/config.h.in $(srcdir)/config.sub
201 scripts = $(srcdir)/install.sh $(srcdir)/mkinstalldirs
202 all = $(docs) $(config) $(srcs) $(parser) $(headers) $(extra) $(scripts)
205 @echo $(all) | tr "[ \t]" '\n' | sort
207 popclient.tar: $(all)
208 tar -cf popclient.tar $(all)
209 popclient.tar.gz: popclient.tar
210 gzip -f popclient.tar
212 # The automatically generated dependencies below may omit config.h
213 # because it is included with ``#include <config.h>'' rather than
214 # ``#include "config.h"''. So we add the explicit dependency to make sure.
217 # Automatically generated dependencies will be put at the end of the file.