Makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. #
  2. # Makefile for http-tiny
  3. # written by L. Demailly
  4. #
  5. # (c)1998 Laurent Demailly
  6. # (c)1996 Observatoire de Paris
  7. #
  8. # $Id: Makefile,v 1.2 1998/09/23 06:17:55 dl Exp $
  9. #
  10. #
  11. # Check the following :
  12. prefix=/usr/local
  13. # where to install executable
  14. BINDIR=$(prefix)/bin
  15. # where to put man pages
  16. MANDIR=$(prefix)/man
  17. # where to put lib
  18. LIBDIR=$(prefix)/lib
  19. # where to put include
  20. INCDIR=$(prefix)/include
  21. # Your compiler
  22. CC = gcc
  23. # Compile flags
  24. CDEBUGFLAGS = -O -Wmissing-prototypes -Wall -ansi -pedantic
  25. #CDEBUGFLAGS = -O
  26. # defines (needed for string ops on linux2/glibc for instance):
  27. DEFINES= -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
  28. # for HPUX (ansi)
  29. #DEFINES= -D_HPUX_SOURCE
  30. # for solaris some defines are needed for strncmp,... but can't find the good
  31. # one... maybe the one above (for linux) work too, I haven't checked yet.
  32. #DEFINES= -D
  33. # others, may need something...
  34. # Solaris
  35. #SYSLIBS= -lsocket -lnsl
  36. #INCLPATH =
  37. # mostly standard
  38. RM= rm -f
  39. CP = cp -f
  40. CHMOD= chmod
  41. MKDIR= mkdir -p
  42. AR = ar
  43. RANLIB = ranlib
  44. TAR= gtar
  45. # no edit should be needed below...
  46. CFLAGS = $(CDEBUGFLAGS) $(INCLPATH) $(DEFINES)
  47. LDFLAGS= $(CFLAGS) -L.
  48. LIBOBJS = http_lib.o
  49. TARGETS = libhttp.a http
  50. all: $(TARGETS)
  51. http: http.o libhttp.a
  52. $(CC) $(LDFLAGS) $@.o -lhttp $(SYSLIBS) -o $@
  53. libhttp.a: $(LIBOBJS)
  54. $(RM) $@
  55. $(AR) r $@ $(LIBOBJS)
  56. $(RANLIB) $@
  57. install: $(TARGETS)
  58. $(CP) http $(BINDIR)
  59. $(CP) libhttp.a $(LIBDIR)
  60. $(CP) man1/http.1 $(MANDIR)/man1
  61. $(CP) man3/http_lib.3 $(MANDIR)/man3
  62. $(CP) http_lib.h $(INCDIR)
  63. clean:
  64. $(RM) $(TARGETS)
  65. $(RM) *.tgz
  66. $(RM) *.o
  67. $(RM) *~
  68. $(RM) #*
  69. $(RM) core
  70. depend:
  71. makedepend $(INCLPATH) $(DEFINES) *.c
  72. # internal use
  73. man3: http_lib.c
  74. $(MKDIR) $@
  75. ( cd $@ ; c2man -i \"http_lib.h\" -ngv -ls ../http_lib.c )
  76. fdoc:
  77. $(RM) -r man3
  78. $(MAKE) man3
  79. pure:
  80. $(MAKE) clean
  81. $(MAKE) CC="purify gcc -g"
  82. tar:
  83. $(MAKE) clean
  84. $(RM) -r http-tiny-$(VERSION)
  85. $(RM) -f http-tiny-*.tar.gz
  86. $(MKDIR) http-tiny-$(VERSION)
  87. -$(CP) * http-tiny-$(VERSION)
  88. $(TAR) cf - man1 | (cd http-tiny-$(VERSION) ; $(TAR) xvf - )
  89. $(TAR) cf - man3 | (cd http-tiny-$(VERSION) ; $(TAR) xvf - )
  90. $(TAR) cvfz http-tiny-$(VERSION).tar.gz http-tiny-$(VERSION)
  91. #distrib: tar
  92. # $(CP) http-tiny-$(VERSION).tar.gz /poubelle/ftp/www/
  93. # $(CP) http-tiny-$(VERSION).tar.gz /users/dl/public_html/
  94. # DO NOT DELETE THIS LINE -- make depend depends on it.