Makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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
  7. # To compile with Unix CC:
  8. # CDEBUGFLAGS=-O
  9. # To compile with GCC:
  10. # CC = gcc
  11. CDEBUGFLAGS = -Os -g -Wall -fno-strict-aliasing
  12. # To compile on a pure POSIX system:
  13. # CC = c89
  14. # CC = c99
  15. # CDEBUGFLAGS=-O
  16. # To compile with icc 7, you need -restrict. (Their bug.)
  17. # CC=icc
  18. # CDEBUGFLAGS = -O -restrict
  19. # On System V (Solaris, HP/UX) you need the following:
  20. # PLATFORM_DEFINES = -DSVR4
  21. # On Solaris, you need the following:
  22. # LDLIBS = -lsocket -lnsl -lresolv
  23. # On mingw, you need
  24. # EXE=.exe
  25. # LDLIBS = -lws2_32
  26. FILE_DEFINES = -DLOCAL_ROOT=\"$(LOCAL_ROOT)/\" \
  27. -DDISK_CACHE_ROOT=\"$(DISK_CACHE_ROOT)/\"
  28. # You may optionally also add any of the following to DEFINES:
  29. #
  30. # -DNO_DISK_CACHE to compile out the on-disk cache and local web server;
  31. # -DNO_IPv6 to avoid using the RFC 3493 API and stick to stock
  32. # Berkeley sockets;
  33. # -DHAVE_IPv6 to force the use of the RFC 3493 API on systems other
  34. # than GNU/Linux and BSD (let me know if it works);
  35. # -DNO_FANCY_RESOLVER to compile out the asynchronous name resolution
  36. # code;
  37. # -DNO_STANDARD_RESOLVER to compile out the code that falls back to
  38. # gethostbyname/getaddrinfo when DNS requests fail;
  39. # -DNO_TUNNEL to compile out the code that handles CONNECT requests;
  40. # -DNO_SOCKS to compile out the SOCKS gateway code.
  41. # -DNO_FORBIDDEN to compile out the all of the forbidden URL code
  42. # -DNO_REDIRECTOR to compile out the Squid-style redirector code
  43. # -DNO_SYSLOG to compile out logging to syslog
  44. DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES)
  45. CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
  46. SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \
  47. config.c local.c http.c client.c server.c auth.c tunnel.c \
  48. http_parse.c parse_time.c dns.c forbidden.c \
  49. md5import.c md5.c ftsimport.c fts_compat.c socks.c mingw.c
  50. OBJS = util.o event.o io.o chunk.o atom.o object.o log.o diskcache.o main.o \
  51. config.o local.o http.o client.o server.o auth.o tunnel.o \
  52. http_parse.o parse_time.o dns.o forbidden.o \
  53. md5import.o ftsimport.o socks.o mingw.o
  54. polipo$(EXE): $(OBJS)
  55. $(CC) $(CFLAGS) $(LDFLAGS) -o polipo$(EXE) $(OBJS) $(MD5LIBS) $(LDLIBS)
  56. ftsimport.o: ftsimport.c fts_compat.c
  57. md5import.o: md5import.c md5.c
  58. .PHONY: all install install.binary install.man
  59. all: polipo$(EXE) polipo.info html/index.html localindex.html
  60. install: install.binary install.man
  61. install.binary: all
  62. mkdir -p $(TARGET)$(BINDIR)
  63. mkdir -p $(TARGET)$(LOCAL_ROOT)
  64. mkdir -p $(TARGET)$(LOCAL_ROOT)/doc
  65. rm -f $(TARGET)$(BINDIR)/polipo
  66. cp -f polipo $(TARGET)$(BINDIR)/
  67. cp -f html/* $(TARGET)$(LOCAL_ROOT)/doc
  68. cp -f localindex.html $(TARGET)$(LOCAL_ROOT)/index.html
  69. install.man: all
  70. mkdir -p $(TARGET)$(MANDIR)/man1
  71. mkdir -p $(TARGET)$(INFODIR)
  72. cp -f polipo.man $(TARGET)$(MANDIR)/man1/polipo.1
  73. cp polipo.info $(TARGET)$(INFODIR)/
  74. install-info --info-dir=$(TARGET)$(INFODIR) polipo.info
  75. polipo.info: polipo.texi
  76. makeinfo polipo.texi
  77. html/index.html: polipo.texi
  78. mkdir -p html
  79. makeinfo --html -o html polipo.texi
  80. polipo.html: polipo.texi
  81. makeinfo --html --no-split --no-headers -o polipo.html polipo.texi
  82. polipo.pdf: polipo.texi
  83. texi2pdf polipo.texi
  84. polipo.ps.gz: polipo.ps
  85. gzip -c polipo.ps > polipo.ps.gz
  86. polipo.ps: polipo.dvi
  87. dvips -Pwww -o polipo.ps polipo.dvi
  88. polipo.dvi: polipo.texi
  89. texi2dvi polipo.texi
  90. polipo.man.html: polipo.man
  91. rman -f html polipo.man > polipo.man.html
  92. TAGS: $(SRCS)
  93. etags $(SRCS)
  94. .PHONY: clean
  95. clean:
  96. -rm -f polipo$(EXE) *.o *~ core TAGS gmon.out
  97. -rm -f polipo.cp polipo.fn polipo.log polipo.vr
  98. -rm -f polipo.cps polipo.info* polipo.pg polipo.toc polipo.vrs
  99. -rm -f polipo.aux polipo.dvi polipo.ky polipo.ps polipo.tp
  100. -rm -f polipo.dvi polipo.ps polipo.ps.gz polipo.pdf polipo.html
  101. -rm -rf ./html/
  102. -rm -f polipo.man.html