1 | #! gmake
|
---|
2 | #
|
---|
3 | # ***** BEGIN LICENSE BLOCK *****
|
---|
4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
5 | #
|
---|
6 | # The contents of this file are subject to the Mozilla Public License Version
|
---|
7 | # 1.1 (the "License"); you may not use this file except in compliance with
|
---|
8 | # the License. You may obtain a copy of the License at
|
---|
9 | # http://www.mozilla.org/MPL/
|
---|
10 | #
|
---|
11 | # Software distributed under the License is distributed on an "AS IS" basis,
|
---|
12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
13 | # for the specific language governing rights and limitations under the
|
---|
14 | # License.
|
---|
15 | #
|
---|
16 | # The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
17 | #
|
---|
18 | # The Initial Developer of the Original Code is
|
---|
19 | # Netscape Communications Corporation.
|
---|
20 | # Portions created by the Initial Developer are Copyright (C) 1998-2000
|
---|
21 | # the Initial Developer. All Rights Reserved.
|
---|
22 | #
|
---|
23 | # Contributor(s):
|
---|
24 | #
|
---|
25 | # Alternatively, the contents of this file may be used under the terms of
|
---|
26 | # either the GNU General Public License Version 2 or later (the "GPL"), or
|
---|
27 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
---|
28 | # in which case the provisions of the GPL or the LGPL are applicable instead
|
---|
29 | # of those above. If you wish to allow use of your version of this file only
|
---|
30 | # under the terms of either the GPL or the LGPL, and not to allow others to
|
---|
31 | # use your version of this file under the terms of the MPL, indicate your
|
---|
32 | # decision by deleting the provisions above and replace them with the notice
|
---|
33 | # and other provisions required by the GPL or the LGPL. If you do not delete
|
---|
34 | # the provisions above, a recipient may use your version of this file under
|
---|
35 | # the terms of any one of the MPL, the GPL or the LGPL.
|
---|
36 | #
|
---|
37 | # ***** END LICENSE BLOCK *****
|
---|
38 |
|
---|
39 | MOD_DEPTH = ..
|
---|
40 | topsrcdir = @top_srcdir@
|
---|
41 | srcdir = @srcdir@
|
---|
42 | VPATH = @srcdir@
|
---|
43 |
|
---|
44 | include $(MOD_DEPTH)/config/autoconf.mk
|
---|
45 |
|
---|
46 | # Indicate that this directory builds build tools.
|
---|
47 | INTERNAL_TOOLS = 1
|
---|
48 |
|
---|
49 | # autoconf.mk must be deleted last (from the top-level directory)
|
---|
50 | # because it is included by every makefile.
|
---|
51 | DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config
|
---|
52 |
|
---|
53 | RELEASE_BINS = nspr-config
|
---|
54 |
|
---|
55 | include $(topsrcdir)/config/config.mk
|
---|
56 |
|
---|
57 | CSRCS = now.c
|
---|
58 |
|
---|
59 | # This version hasn't been ported for us; the one in mozilla/config has
|
---|
60 | ifneq ($(OS_ARCH),OS2)
|
---|
61 | CSRCS += nsinstall.c
|
---|
62 |
|
---|
63 | PLSRCS = nfspwd.pl
|
---|
64 | endif
|
---|
65 |
|
---|
66 | ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH)))
|
---|
67 | PROG_SUFFIX = .exe
|
---|
68 | else
|
---|
69 | PROG_SUFFIX =
|
---|
70 | endif
|
---|
71 |
|
---|
72 | # Temporary workaround to disable the generation of
|
---|
73 | # library build time because now.c uses the 'long long'
|
---|
74 | # data type that's not available on some platforms.
|
---|
75 | ifeq (,$(filter-out NEC NEXTSTEP QNX SCOOS UNIXWARE,$(OS_ARCH)))
|
---|
76 | DEFINES += -DOMIT_LIB_BUILD_TIME
|
---|
77 | endif
|
---|
78 |
|
---|
79 | ifeq ($(OS_ARCH), IRIX)
|
---|
80 | ifeq ($(basename $(OS_RELEASE)),6)
|
---|
81 | ifndef NS_USE_GCC
|
---|
82 | ifeq ($(USE_N32),1)
|
---|
83 | XLDOPTS += -n32 -Wl,-woff,85
|
---|
84 | else
|
---|
85 | ifeq ($(USE_64),1)
|
---|
86 | XLDOPTS += -64
|
---|
87 | else
|
---|
88 | XLDOPTS += -32
|
---|
89 | endif
|
---|
90 | endif
|
---|
91 | endif
|
---|
92 | endif
|
---|
93 | endif
|
---|
94 |
|
---|
95 | ifeq ($(OS_ARCH), HP-UX)
|
---|
96 | ifeq ($(USE_64),1)
|
---|
97 | XLDOPTS += +DD64
|
---|
98 | endif
|
---|
99 | endif
|
---|
100 |
|
---|
101 | ifeq ($(MOZ_OS2_TOOLS),EMX)
|
---|
102 | XCFLAGS = $(OS_CFLAGS)
|
---|
103 | ifeq ($(MOZ_OS2_EMX_OBJECTFORMAT),OMF)
|
---|
104 | XLDOPTS = -Zlinker /PM:VIO
|
---|
105 | endif
|
---|
106 | endif
|
---|
107 |
|
---|
108 | ifeq ($(MOZ_OS2_TOOLS),PGCC)
|
---|
109 | XCFLAGS = $(OS_CFLAGS)
|
---|
110 | XLDOPTS = -Zlinker /PM:VIO
|
---|
111 | endif
|
---|
112 |
|
---|
113 | include $(topsrcdir)/config/rules.mk
|
---|
114 |
|
---|
115 | PROGS = $(OBJDIR)/now$(PROG_SUFFIX)
|
---|
116 |
|
---|
117 | ifeq (,$(CROSS_COMPILE)$(filter-out OS2 WINNT,$(OS_ARCH)))
|
---|
118 | TARGETS = $(PROGS)
|
---|
119 | else
|
---|
120 | PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX)
|
---|
121 | TARGETS = $(PROGS) $(PLSRCS:.pl=)
|
---|
122 | endif
|
---|
123 |
|
---|
124 | OUTOPTION = -o # end of the line
|
---|
125 | ifeq (,$(filter-out WINNT WIN95,$(OS_TARGET)))
|
---|
126 | ifndef NS_USE_GCC
|
---|
127 | OUTOPTION = /Fe
|
---|
128 | endif
|
---|
129 | endif
|
---|
130 |
|
---|
131 | # Redefine MAKE_OBJDIR for just this directory
|
---|
132 | define MAKE_OBJDIR
|
---|
133 | if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi
|
---|
134 | endef
|
---|
135 |
|
---|
136 | export:: $(TARGETS)
|
---|
137 | rm -f $(dist_bindir)/nspr-config
|
---|
138 |
|
---|
139 | $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
|
---|
140 | @$(MAKE_OBJDIR)
|
---|
141 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
142 | $(LD) $(EXEFLAGS) $<
|
---|
143 | else
|
---|
144 | $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@
|
---|
145 | endif
|
---|
146 |
|
---|
147 | real_install:: nspr.m4
|
---|
148 | $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal
|
---|
149 | $(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal
|
---|