Makefile.osx-panther 3.3 KB

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