Makefile 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. CC = cc
  30. SHELL = /bin/sh
  31. ECHO = /bin/echo
  32. DEPTH = ..
  33. BUILD =
  34. TARGETDIR = obj
  35. DEFINES =
  36. OTHER_FLAGS =
  37. CFLAGS =
  38. OBJDIR = $(DEPTH)/$(TARGETDIR)
  39. INCDIR = $(DEPTH)/$(TARGETDIR)
  40. LIBRESOLV =
  41. EXTRALIBS =
  42. SLIBRARY = $(OBJDIR)/libstx.a
  43. OBJS = $(OBJDIR)/dnscache.o $(OBJDIR)/dnsres.o $(OBJDIR)/lrucache.o
  44. CFLAGS += -Wall -I$(INCDIR)
  45. AR = ar
  46. ARFLAGS = rv
  47. RANLIB = ranlib
  48. ##########################
  49. # Platform section.
  50. #
  51. ifeq (LINUX, $(findstring LINUX, $(OS)))
  52. LIBRESOLV = -lresolv
  53. endif
  54. ifeq ($(OS), SOLARIS)
  55. LIBRESOLV = -lresolv
  56. EXTRALIBS = -lsocket -lnsl
  57. endif
  58. #
  59. # End of platform section.
  60. ##########################
  61. all: $(SLIBRARY)
  62. $(SLIBRARY): $(OBJS)
  63. $(AR) $(ARFLAGS) $@ $(OBJS)
  64. $(RANLIB) $@
  65. $(OBJDIR)/%.o: %.c stx.h common.h
  66. $(CC) $(CFLAGS) -c $< -o $@
  67. clean:
  68. rm -rf $(OBJS) $(SLIBRARY)
  69. #.DEFAULT:
  70. # @cd $(DEPTH); $(MAKE) $@