Implement CONFIG_PASSWORD.
[polipo.git] / Makefile
blob638a967c564557ecb24d9e2bbf843def200d7438
1 PREFIX = /usr/local
2 BINDIR = $(PREFIX)/bin
3 MANDIR = $(PREFIX)/man
4 INFODIR = $(PREFIX)/info
5 LOCAL_ROOT = /usr/share/polipo/www
6 DISK_CACHE_ROOT = /var/cache/polipo
8 # To compile with Unix CC:
10 # CDEBUGFLAGS=-O
12 # To compile with GCC (add -Wno-pointer-sign if using GCC 4):
14 # CC = gcc
15 # CDEBUGFLAGS = -O2 -g -Wall -std=gnu99
16 CDEBUGFLAGS = -Os -g -Wall
17 # CDEBUGFLAGS = -O2 -Wall
18 # CDEBUGFLAGS = -g -Wall
20 # To compile on a pure POSIX system:
22 # CC = c89
23 # CC = c99
24 # CDEBUGFLAGS=-O
26 # To compile with icc 7, you need -restrict. (Their bug.)
28 # CC=icc
29 # CDEBUGFLAGS = -O -restrict
31 # On System V (Solaris, HP/UX) you need the following:
33 # PLATFORM_DEFINES = -DSVR4
35 # On Solaris, you need the following:
37 # LDLIBS = -lsocket -lnsl -lresolv
39 FILE_DEFINES = -DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \
40 -DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\"
42 # You may optionally also add any of the following to DEFINES:
44 # -DNO_DISK_CACHE to compile out the on-disk cache and local web server;
45 # -DNO_IPv6 to avoid using the RFC 3493 API and stick to stock
46 # Berkeley sockets;
47 # -DHAVE_IPv6 to force the use of the RFC 3493 API on systems other
48 # than GNU/Linux and BSD (let me know if it works);
49 # -DNO_FANCY_RESOLVER to compile out the asynchronous name resolution
50 # code;
51 # -DNO_STANDARD_RESOLVER to compile out the code that falls back to
52 # gethostbyname/getaddrinfo when DNS requests fail;
53 # -DNO_TUNNEL to compile out the code that handles CONNECT requests;
54 # -DNO_SOCKS to compile out the SOCKS gateway code.
55 # -DNO_FORBIDDEN to compile out the all of the forbidden URL code
56 # -DNO_REDIRECTOR to compile out the Squid-style redirector code
58 DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES)
60 CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
62 SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \
63 config.c local.c http.c client.c server.c auth.c tunnel.c \
64 http_parse.c parse_time.c dns.c forbidden.c \
65 md5import.c md5.c ftsimport.c fts_compat.c socks.c mingw.c
67 OBJS = util.o event.o io.o chunk.o atom.o object.o log.o diskcache.o main.o \
68 config.o local.o http.o client.o server.o auth.o tunnel.o \
69 http_parse.o parse_time.o dns.o forbidden.o \
70 md5import.o ftsimport.o socks.o mingw.o
72 polipo: $(OBJS)
73 $(CC) $(CFLAGS) $(LDFLAGS) -o polipo $(OBJS) $(MD5LIBS) $(LDLIBS)
75 ftsimport.o: ftsimport.c fts_compat.c
77 md5import.o: md5import.c md5.c
79 all: polipo polipo.info html/index.html localindex.html
81 install: install.binary install.man
83 install.binary: all
84 mkdir -p $(TARGET)$(BINDIR)
85 mkdir -p $(TARGET)$(LOCAL_ROOT)
86 mkdir -p $(TARGET)$(LOCAL_ROOT)/doc
87 rm -f $(TARGET)$(BINDIR)/polipo
88 cp -f polipo $(TARGET)$(BINDIR)/
89 cp -f html/* $(TARGET)$(LOCAL_ROOT)/doc
90 cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html
92 install.man: all
93 mkdir -p $(TARGET)$(MANDIR)/man1
94 mkdir -p $(TARGET)$(INFODIR)
95 cp -f polipo.man $(TARGET)$(MANDIR)/man1/polipo.1
96 cp polipo.info $(TARGET)$(INFODIR)/
97 install-info --info-dir=$(INFODIR) polipo.info
100 polipo.info: polipo.texi
101 makeinfo polipo.texi
103 html/index.html: polipo.texi
104 mkdir -p html
105 makeinfo --html -o html polipo.texi
107 polipo.html: polipo.texi
108 makeinfo --html --no-split --no-headers -o polipo.html polipo.texi
110 polipo.pdf: polipo.texi
111 texi2pdf polipo.texi
113 polipo.ps.gz: polipo.ps
114 gzip -c polipo.ps > polipo.ps.gz
116 polipo.ps: polipo.dvi
117 dvips -Pwww -o polipo.ps polipo.dvi
119 polipo.dvi: polipo.texi
120 texi2dvi polipo.texi
122 polipo.man.html: polipo.man
123 groff -man -Thtml polipo.man > polipo.man.html
125 TAGS: $(SRCS)
126 etags $(SRCS)
128 clean:
129 -rm -f polipo *.o *~ core TAGS gmon.out
130 -rm -f polipo.cp polipo.fn polipo.log polipo.vr
131 -rm -f polipo.cps polipo.info* polipo.pg polipo.toc polipo.vrs
132 -rm -f polipo.aux polipo.dvi polipo.ky polipo.ps polipo.tp
133 -rm -f polipo.dvi polipo.ps polipo.ps.gz polipo.pdf polipo.html
134 -rm -rf ./html/
135 -rm -f polipo.man.html