Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #
  2. # Portions created by SGI are Copyright (C) 2000 Silicon Graphics, Inc.
  3. # All Rights Reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. #
  9. # 1. Redistributions of source code must retain the above copyright
  10. # notice, this list of conditions and the following disclaimer.
  11. # 2. Redistributions in binary form must reproduce the above copyright
  12. # notice, this list of conditions and the following disclaimer in the
  13. # documentation and/or other materials provided with the distribution.
  14. # 3. Neither the name of Silicon Graphics, Inc. nor the names of its
  15. # contributors may be used to endorse or promote products derived from
  16. # this software without specific prior written permission.
  17. #
  18. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  19. # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  20. # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  21. # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  22. # HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  23. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
  24. # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  25. # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  26. # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  27. # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  28. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  29. ##########################
  30. # Supported OSes:
  31. #
  32. # AIX
  33. # FREEBSD
  34. # HPUX
  35. # HPUX_64
  36. # IRIX
  37. # IRIX_64
  38. # LINUX
  39. # LINUX_IA64
  40. # NETBSD
  41. # OPENBSD
  42. # OSF1
  43. # SOLARIS
  44. # SOLARIS_64
  45. ##########################
  46. CC = cc
  47. SHELL = /bin/sh
  48. ECHO = /bin/echo
  49. DEPTH = ..
  50. BUILD =
  51. TARGETDIR =
  52. DEFINES =
  53. CFLAGS =
  54. OTHER_FLAGS =
  55. OBJDIR = $(DEPTH)/$(TARGETDIR)
  56. INCDIR = $(DEPTH)/$(TARGETDIR)
  57. LIBST = $(OBJDIR)/libst.a
  58. HEADER = $(INCDIR)/st.h
  59. LIBRESOLV =
  60. EXTRALIBS =
  61. ifeq ($(OS),)
  62. EXAMPLES = unknown
  63. else
  64. EXAMPLES = $(OBJDIR)/lookupdns $(OBJDIR)/proxy $(OBJDIR)/server
  65. endif
  66. ##########################
  67. # Platform section.
  68. #
  69. ifeq (DARWIN, $(findstring DARWIN, $(OS)))
  70. LIBRESOLV = -lresolv
  71. endif
  72. ifeq (LINUX, $(findstring LINUX, $(OS)))
  73. LIBRESOLV = -lresolv
  74. endif
  75. ifeq (SOLARIS, $(findstring SOLARIS, $(OS)))
  76. LIBRESOLV = -lresolv
  77. EXTRALIBS = -lsocket -lnsl
  78. endif
  79. #
  80. # End of platform section.
  81. ##########################
  82. all: $(EXAMPLES)
  83. $(OBJDIR)/lookupdns: lookupdns.c $(OBJDIR)/res.o $(LIBST) $(HEADER)
  84. $(CC) $(CFLAGS) -I$(INCDIR) lookupdns.c $(OBJDIR)/res.o $(LIBST) $(LIBRESOLV) $(EXTRALIBS) -o $@
  85. $(OBJDIR)/proxy: proxy.c $(LIBST) $(HEADER)
  86. $(CC) $(CFLAGS) -I$(INCDIR) proxy.c $(LIBST) $(EXTRALIBS) -o $@
  87. $(OBJDIR)/server: server.c $(OBJDIR)/error.o $(LIBST) $(HEADER)
  88. $(CC) $(CFLAGS) -I$(INCDIR) server.c $(OBJDIR)/error.o $(LIBST) $(EXTRALIBS) -o $@
  89. $(OBJDIR)/%.o: %.c
  90. $(CC) $(CFLAGS) -I$(INCDIR) -c $< -o $@
  91. .DEFAULT:
  92. @cd $(DEPTH); $(MAKE) $@