add proposal 159, 'exit scanning', from or-dev
[tor/rransom.git] / contrib / polipo / Makefile.osx
blob8e748e2adb2c3acff6545f055d530b91154a3ff9
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 UNIVERSAL = -O -g -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc
34 LDFLAGS = -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk
35 CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES) $(UNIVERSAL)
37 SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \
38        config.c local.c http.c client.c server.c auth.c tunnel.c \
39        http_parse.c parse_time.c dns.c forbidden.c \
40        md5import.c md5.c ftsimport.c fts_compat.c socks.c 
42 OBJS = util.o event.o io.o chunk.o atom.o object.o log.o diskcache.o main.o \
43        config.o local.o http.o client.o server.o auth.o tunnel.o \
44        http_parse.o parse_time.o dns.o forbidden.o \
45        md5import.o ftsimport.o socks.o 
47 polipo: $(OBJS) 
48         $(CC) $(CFLAGS) $(LDFLAGS) -o polipo $(OBJS) $(MD5LIBS) $(LDLIBS)
50 ftsimport.o: ftsimport.c fts_compat.c
52 md5import.o: md5import.c md5.c
54 .PHONY: all install install.binary install.man
56 all: polipo 
58 install: install.binary install.man
60 install.binary: all
61         mkdir -p $(TARGET)$(BINDIR)
62         mkdir -p $(TARGET)$(LOCAL_ROOT)
63         mkdir -p $(TARGET)$(LOCAL_ROOT)/doc
64         mkdir -p $(TARGET)$(DISK_CACHE_ROOT)
65         cp -f polipo $(TARGET)$(BINDIR)/
66         cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html
67         cp -f config.osx $(TARGET)$(LOCAL_ROOT)/config
68         texi2html polipo.texi && cp -f polipo.html $(TARGET)$(LOCAL_ROOT)/doc/index.html 
69         groff polipo.man -T ps -m man | pstopdf -i -o $(TARGET)/polipo.pdf
70         mkdir -p /Library/StartupItems/Polipo
71         cp -f contrib/Polipo /Library/StartupItems/Polipo/
72         cp -f contrib/StartupParameters.plist /Library/StartupItems/Polipo/
73         echo "POLIPO=-YES-" >> /etc/hostconfig
75 install.man: all
76         mkdir -p $(TARGET)$(MANDIR)/man1
77         cp -f polipo.man $(TARGET)$(MANDIR)/man1/polipo.1
79 TAGS: $(SRCS)
80         etags $(SRCS)
82 .PHONY: clean
84 clean:
85         -rm -f polipo *.o *~ core TAGS gmon.out
86         -rm -f polipo.cp polipo.fn polipo.log polipo.vr
87         -rm -f polipo.cps polipo.info* polipo.pg polipo.toc polipo.vrs
88         -rm -f polipo.aux polipo.dvi polipo.ky polipo.ps polipo.tp
89         -rm -f polipo.dvi polipo.ps polipo.ps.gz polipo.pdf polipo.html
90         -rm -rf ./html/
91         -rm -f polipo.man.html
93 .PHONY: uninstall
95 uninstall:
96         rm -rf /Library/Polipo
97         rm -rf /Library/StartupItems/Polipo
98         cp -f /etc/hostconfig /etc/hostconfig.polipo.saved
99         cat /etc/hostconfig.polipo.saved | grep -v POLIPO > /etc/hostconfig