Fix memory leak spotted by Nick.
[tor/rransom.git] / contrib / polipo / Makefile.osx-panther
blobd1d24d1f3c90566a16667bb5ae33fb2fc9d8d67f
1 PREFIX = /Library/Polipo
2 BINDIR = $(PREFIX)/bin
3 MANDIR = $(PREFIX)/man
4 INFODIR = $(PREFIX)/info
5 LOCAL_ROOT = $(PREFIX)/www
6 DISK_CACHE_ROOT = $(PREFIX)/cache
8 CC = gcc
9 # CDEBUGFLAGS = -Os -g -Wall -std=gnu99
10 CDEBUGFLAGS = -Os -g -Wall
12 FILE_DEFINES = -DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \
13                -DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\"
15 # You may optionally also add any of the following to DEFINES:
17 #  -DNO_DISK_CACHE to compile out the on-disk cache and local web server;
18 #  -DNO_IPv6 to avoid using the RFC 3493 API and stick to stock
19 #      Berkeley sockets;
20 #  -DHAVE_IPv6 to force the use of the RFC 3493 API on systems other
21 #      than GNU/Linux and BSD (let me know if it works);
22 #  -DNO_FANCY_RESOLVER to compile out the asynchronous name resolution
23 #      code;
24 #  -DNO_STANDARD_RESOLVER to compile out the code that falls back to
25 #      gethostbyname/getaddrinfo when DNS requests fail;
26 #  -DNO_TUNNEL to compile out the code that handles CONNECT requests;
27 #  -DNO_SOCKS to compile out the SOCKS gateway code.
28 #  -DNO_FORBIDDEN to compile out the all of the forbidden URL code
29 #  -DNO_REDIRECTOR to compile out the Squid-style redirector code
31 DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES)
33 CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
35 SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \
36        config.c local.c http.c client.c server.c auth.c tunnel.c \
37        http_parse.c parse_time.c dns.c forbidden.c \
38        md5import.c md5.c ftsimport.c fts_compat.c socks.c 
40 OBJS = util.o event.o io.o chunk.o atom.o object.o log.o diskcache.o main.o \
41        config.o local.o http.o client.o server.o auth.o tunnel.o \
42        http_parse.o parse_time.o dns.o forbidden.o \
43        md5import.o ftsimport.o socks.o 
45 polipo: $(OBJS) 
46         $(CC) $(CFLAGS) $(LDFLAGS) -o polipo $(OBJS) $(MD5LIBS) $(LDLIBS)
48 ftsimport.o: ftsimport.c fts_compat.c
50 md5import.o: md5import.c md5.c
52 .PHONY: all install install.binary install.man
54 all: polipo 
56 install: install.binary install.man
58 install.binary: all
59         mkdir -p $(TARGET)$(BINDIR)
60         mkdir -p $(TARGET)$(LOCAL_ROOT)
61         mkdir -p $(TARGET)$(LOCAL_ROOT)/doc
62         mkdir -p $(TARGET)$(DISK_CACHE_ROOT)
63         cp -f polipo $(TARGET)$(BINDIR)/
64         cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html
65         cp -f config.osx $(TARGET)$(LOCAL_ROOT)/config
66         texi2html polipo.texi && cp -f polipo.html $(TARGET)$(LOCAL_ROOT)/doc/index.html 
67         groff polipo.man -T ps -m man | pstopdf -i -o $(TARGET)/polipo.pdf
68         mkdir -p /Library/StartupItems/Polipo
69         cp -f contrib/Polipo /Library/StartupItems/Polipo/
70         cp -f contrib/StartupParameters.plist /Library/StartupItems/Polipo/
71         echo "POLIPO=-YES-" >> /etc/hostconfig
73 install.man: all
74         mkdir -p $(TARGET)$(MANDIR)/man1
75         cp -f polipo.man $(TARGET)$(MANDIR)/man1/polipo.1
77 TAGS: $(SRCS)
78         etags $(SRCS)
80 .PHONY: clean
82 clean:
83         -rm -f polipo *.o *~ core TAGS gmon.out
84         -rm -f polipo.cp polipo.fn polipo.log polipo.vr
85         -rm -f polipo.cps polipo.info* polipo.pg polipo.toc polipo.vrs
86         -rm -f polipo.aux polipo.dvi polipo.ky polipo.ps polipo.tp
87         -rm -f polipo.dvi polipo.ps polipo.ps.gz polipo.pdf polipo.html
88         -rm -rf ./html/
89         -rm -f polipo.man.html
91 .PHONY: uninstall
93 uninstall:
94         rm -rf /Library/Polipo
95         rm -rf /Library/StartupItems/Polipo
96         cp -f /etc/hostconfig /etc/hostconfig.polipo.saved
97         cat /etc/hostconfig.polipo.saved | grep -v POLIPO > /etc/hostconfig