Makefile.in 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. #
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. #! gmake
  6. MOD_DEPTH = ..
  7. topsrcdir = @top_srcdir@
  8. srcdir = @srcdir@
  9. VPATH = @srcdir@
  10. include $(MOD_DEPTH)/config/autoconf.mk
  11. include $(topsrcdir)/config/config.mk
  12. ifeq ($(OS_TARGET), WIN16)
  13. OS_CFLAGS = $(OS_EXE_CFLAGS)
  14. endif
  15. DIRS =
  16. CSRCS = \
  17. httpget.c \
  18. tail.c \
  19. $(NULL)
  20. ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
  21. PROG_SUFFIX = .exe
  22. else
  23. PROG_SUFFIX =
  24. endif
  25. PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
  26. TARGETS = $(PROGS)
  27. INCLUDES = -I$(dist_includedir)
  28. NSPR_VERSION = 3
  29. # Setting the variables LDOPTS and LIBPR. We first initialize
  30. # them to the default values, then adjust them for some platforms.
  31. LDOPTS = -L$(dist_libdir)
  32. LIBPR = -lnspr$(NSPR_VERSION)
  33. LIBPLC = -lplc$(NSPR_VERSION)
  34. ifeq ($(OS_ARCH), WINNT)
  35. ifeq ($(OS_TARGET), WIN16)
  36. LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
  37. LIBPLC= $(dist_libdir)/plc$(NSPR_VERSION).lib
  38. else
  39. LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
  40. LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).$(LIB_SUFFIX)
  41. LIBPLC= $(dist_libdir)/libplc$(NSPR_VERSION).$(LIB_SUFFIX)
  42. endif
  43. endif
  44. ifeq ($(OS_ARCH),OS2)
  45. LDOPTS += -Zomf -Zlinker /PM:VIO
  46. endif
  47. ifneq ($(OS_ARCH), WINNT)
  48. PWD = $(shell pwd)
  49. endif
  50. ifeq ($(OS_ARCH), HP-UX)
  51. LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
  52. endif
  53. # AIX
  54. ifeq ($(OS_ARCH),AIX)
  55. LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
  56. LIBPR = -lnspr$(NSPR_VERSION)_shr
  57. LIBPLC = -lplc$(NSPR_VERSION)_shr
  58. endif
  59. # Solaris
  60. ifeq ($(OS_ARCH), SunOS)
  61. ifdef NS_USE_GCC
  62. LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
  63. else
  64. LDOPTS += -R $(PWD)/$(dist_libdir)
  65. endif
  66. # SunOS 5.5 needs to link with -lpthread, even though we already
  67. # linked with this system library when we built libnspr.so.
  68. ifeq ($(OS_RELEASE), 5.5)
  69. ifdef USE_PTHREADS
  70. EXTRA_LIBS = -lpthread
  71. endif
  72. endif
  73. endif # SunOS
  74. ifeq ($(OS_ARCH), SCOOS)
  75. # SCO Unix needs to link against -lsocket again even though we
  76. # already linked with these system libraries when we built libnspr.so.
  77. EXTRA_LIBS = -lsocket
  78. # This hardcodes in the executable programs the directory to find
  79. # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
  80. # option for ld on other platforms.
  81. export LD_RUN_PATH = $(PWD)/$(dist_libdir)
  82. endif
  83. #####################################################
  84. #
  85. # The rules
  86. #
  87. #####################################################
  88. include $(topsrcdir)/config/rules.mk
  89. AIX_PRE_4_2 = 0
  90. ifeq ($(OS_ARCH),AIX)
  91. ifneq ($(OS_RELEASE),4.2)
  92. ifneq ($(USE_PTHREADS), 1)
  93. #AIX_PRE_4_2 = 1
  94. endif
  95. endif
  96. endif
  97. ifeq ($(AIX_PRE_4_2),1)
  98. # AIX releases prior to 4.2 need a special two-step linking hack
  99. # in order to both override the system select() and be able to
  100. # get at the original system select().
  101. #
  102. # We use a pattern rule in ns/nspr20/config/rules.mk to generate
  103. # the .$(OBJ_SUFFIX) file from the .c source file, then do the
  104. # two-step linking hack below.
  105. $(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
  106. @$(MAKE_OBJDIR)
  107. rm -f $@ $(AIX_TMP)
  108. $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(NSPR_VERSION).a
  109. $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
  110. rm -f $(AIX_TMP)
  111. else
  112. # All platforms that are not AIX pre-4.2.
  113. $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
  114. @$(MAKE_OBJDIR)
  115. ifeq ($(OS_ARCH), WINNT)
  116. ifeq ($(OS_TARGET),WIN16)
  117. echo system windows >w16link
  118. echo option map >>w16link
  119. echo option stack=10K >>w16link
  120. echo option heapsize=32K >>w16link
  121. echo debug $(DEBUGTYPE) all >>w16link
  122. echo name $@ >>w16link
  123. echo file >>w16link
  124. echo $< >>w16link
  125. echo library >>w16link
  126. echo $(LIBPR), >>w16link
  127. echo $(LIBPLC), >>w16link
  128. echo winsock.lib >>w16link
  129. wlink @w16link.
  130. else
  131. link $(LDOPTS) $< $(LIBPR) $(LIBPLC) ws2_32.lib -out:$@
  132. endif
  133. else
  134. ifeq ($(OS_ARCH),OS2)
  135. $(LINK) $(LDOPTS) $< $(LIBPR) $(LIBPLC) $(OS_LIBS) $(EXTRA_LIBS) -o $@
  136. else
  137. $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPLC) $(EXTRA_LIBS) -o $@
  138. endif
  139. endif
  140. endif
  141. export:: $(TARGETS)
  142. clean::
  143. rm -f $(TARGETS)