Bug 1807268 - Fix verifyOpenAllInNewTabsOptionTest UI test r=ohorvath
[gecko.git] / nsprpub / tools / Makefile.in
blob29f19d94acd5c76bf2ab5df7a3acb024c38fdde3
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/.
6 #! gmake
8 MOD_DEPTH = ..
9 topsrcdir = @top_srcdir@
10 srcdir = @srcdir@
11 VPATH = @srcdir@
13 include $(MOD_DEPTH)/config/autoconf.mk
15 include $(topsrcdir)/config/config.mk
17 ifeq ($(OS_TARGET), WIN16)
18 OS_CFLAGS = $(OS_EXE_CFLAGS)
19 endif
22 DIRS =
24 CSRCS = \
25 httpget.c \
26 tail.c \
27 $(NULL)
29 ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
30 PROG_SUFFIX = .exe
31 else
32 PROG_SUFFIX =
33 endif
35 PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
37 TARGETS = $(PROGS)
39 INCLUDES = -I$(dist_includedir)
41 NSPR_VERSION = 3
43 # Setting the variables LDOPTS and LIBPR. We first initialize
44 # them to the default values, then adjust them for some platforms.
45 LDOPTS = -L$(dist_libdir)
46 LIBPR = -lnspr$(NSPR_VERSION)
47 LIBPLC = -lplc$(NSPR_VERSION)
49 ifeq ($(OS_ARCH), WINNT)
50 ifeq ($(OS_TARGET), WIN16)
51 LIBPR = $(dist_libdir)/nspr$(NSPR_VERSION).lib
52 LIBPLC= $(dist_libdir)/plc$(NSPR_VERSION).lib
53 else
54 LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
55 LIBPR = $(dist_libdir)/libnspr$(NSPR_VERSION).$(LIB_SUFFIX)
56 LIBPLC= $(dist_libdir)/libplc$(NSPR_VERSION).$(LIB_SUFFIX)
57 endif
58 endif
60 ifeq ($(OS_ARCH),OS2)
61 LDOPTS += -Zomf -Zlinker /PM:VIO
62 endif
64 ifneq ($(OS_ARCH), WINNT)
65 PWD = $(shell pwd)
66 endif
68 ifeq ($(OS_ARCH), HP-UX)
69 LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
70 endif
72 # AIX
73 ifeq ($(OS_ARCH),AIX)
74 LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
75 LIBPR = -lnspr$(NSPR_VERSION)_shr
76 LIBPLC = -lplc$(NSPR_VERSION)_shr
77 endif
79 # Solaris
80 ifeq ($(OS_ARCH), SunOS)
81 ifdef NS_USE_GCC
82 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
83 else
84 LDOPTS += -R $(PWD)/$(dist_libdir)
85 endif
87 # SunOS 5.5 needs to link with -lpthread, even though we already
88 # linked with this system library when we built libnspr.so.
89 ifeq ($(OS_RELEASE), 5.5)
90 ifdef USE_PTHREADS
91 EXTRA_LIBS = -lpthread
92 endif
93 endif
94 endif # SunOS
96 ifeq ($(OS_ARCH), SCOOS)
97 # SCO Unix needs to link against -lsocket again even though we
98 # already linked with these system libraries when we built libnspr.so.
99 EXTRA_LIBS = -lsocket
100 # This hardcodes in the executable programs the directory to find
101 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
102 # option for ld on other platforms.
103 export LD_RUN_PATH = $(PWD)/$(dist_libdir)
104 endif
106 #####################################################
108 # The rules
110 #####################################################
112 include $(topsrcdir)/config/rules.mk
114 AIX_PRE_4_2 = 0
115 ifeq ($(OS_ARCH),AIX)
116 ifneq ($(OS_RELEASE),4.2)
117 ifneq ($(USE_PTHREADS), 1)
118 #AIX_PRE_4_2 = 1
119 endif
120 endif
121 endif
123 ifeq ($(AIX_PRE_4_2),1)
125 # AIX releases prior to 4.2 need a special two-step linking hack
126 # in order to both override the system select() and be able to
127 # get at the original system select().
129 # We use a pattern rule in ns/nspr20/config/rules.mk to generate
130 # the .$(OBJ_SUFFIX) file from the .c source file, then do the
131 # two-step linking hack below.
133 $(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
134 @$(MAKE_OBJDIR)
135 rm -f $@ $(AIX_TMP)
136 $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(NSPR_VERSION).a
137 $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
138 rm -f $(AIX_TMP)
140 else
142 # All platforms that are not AIX pre-4.2.
144 $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
145 @$(MAKE_OBJDIR)
146 ifeq ($(OS_ARCH), WINNT)
147 ifeq ($(OS_TARGET),WIN16)
148 echo system windows >w16link
149 echo option map >>w16link
150 echo option stack=10K >>w16link
151 echo option heapsize=32K >>w16link
152 echo debug $(DEBUGTYPE) all >>w16link
153 echo name $@ >>w16link
154 echo file >>w16link
155 echo $< >>w16link
156 echo library >>w16link
157 echo $(LIBPR), >>w16link
158 echo $(LIBPLC), >>w16link
159 echo winsock.lib >>w16link
160 wlink @w16link.
161 else
162 link $(LDOPTS) $< $(LIBPR) $(LIBPLC) ws2_32.lib -out:$@
163 endif
164 else
165 ifeq ($(OS_ARCH),OS2)
166 $(LINK) $(LDOPTS) $< $(LIBPR) $(LIBPLC) $(OS_LIBS) $(EXTRA_LIBS) -o $@
167 else
168 $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPLC) $(EXTRA_LIBS) -o $@
169 endif
170 endif
171 endif
173 export:: $(TARGETS)
174 clean::
175 rm -f $(TARGETS)