| 1 |
#! gmake |
| 2 |
# |
| 3 |
# This Source Code Form is subject to the terms of the Mozilla Public |
| 4 |
# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 |
# file, You can obtain one at http://mozilla.org/MPL/2.0/. |
| 6 |
|
| 7 |
MOD_DEPTH = .. |
| 8 |
topsrcdir = @top_srcdir@ |
| 9 |
srcdir = @srcdir@ |
| 10 |
VPATH = @srcdir@ |
| 11 |
|
| 12 |
include $(MOD_DEPTH)/config/autoconf.mk |
| 13 |
|
| 14 |
# Indicate that this directory builds build tools. |
| 15 |
INTERNAL_TOOLS = 1 |
| 16 |
|
| 17 |
# For sanity's sake, we compile nsinstall without the wrapped system |
| 18 |
# headers, so that we can use it to set up the wrapped system headers. |
| 19 |
VISIBILITY_FLAGS = |
| 20 |
|
| 21 |
# autoconf.mk must be deleted last (from the top-level directory) |
| 22 |
# because it is included by every makefile. |
| 23 |
DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config nspr.pc |
| 24 |
|
| 25 |
RELEASE_BINS = nspr-config |
| 26 |
|
| 27 |
include $(topsrcdir)/config/config.mk |
| 28 |
|
| 29 |
CSRCS = now.c |
| 30 |
|
| 31 |
CSRCS += nsinstall.c |
| 32 |
PLSRCS = nfspwd.pl |
| 33 |
|
| 34 |
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) |
| 35 |
PROG_SUFFIX = .exe |
| 36 |
else |
| 37 |
PROG_SUFFIX = |
| 38 |
endif |
| 39 |
|
| 40 |
# Temporary workaround to disable the generation of |
| 41 |
# library build time because now.c uses the 'long long' |
| 42 |
# data type that's not available on some platforms. |
| 43 |
ifeq (,$(filter-out QNX,$(OS_ARCH))) |
| 44 |
DEFINES += -DOMIT_LIB_BUILD_TIME |
| 45 |
endif |
| 46 |
|
| 47 |
ifeq ($(OS_ARCH), HP-UX) |
| 48 |
ifeq ($(USE_64),1) |
| 49 |
XLDOPTS += +DD64 |
| 50 |
endif |
| 51 |
endif |
| 52 |
|
| 53 |
include $(topsrcdir)/config/rules.mk |
| 54 |
|
| 55 |
PROGS = $(OBJDIR)/now$(PROG_SUFFIX) |
| 56 |
|
| 57 |
ifeq (,$(CROSS_COMPILE)$(filter-out WINNT,$(OS_ARCH))) |
| 58 |
TARGETS = $(PROGS) |
| 59 |
else |
| 60 |
ifeq (,$(filter-out WINCE,$(OS_ARCH))) |
| 61 |
TARGETS = $(PROGS) |
| 62 |
else |
| 63 |
PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX) |
| 64 |
TARGETS = $(PROGS) $(PLSRCS:.pl=) |
| 65 |
endif |
| 66 |
endif |
| 67 |
|
| 68 |
OUTOPTION = -o # end of the line |
| 69 |
ifeq (,$(filter-out WINNT WIN95 WINCE,$(OS_TARGET))) |
| 70 |
ifndef NS_USE_GCC |
| 71 |
OUTOPTION = -Fe |
| 72 |
endif |
| 73 |
endif |
| 74 |
|
| 75 |
# Redefine MAKE_OBJDIR for just this directory |
| 76 |
define MAKE_OBJDIR |
| 77 |
if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi |
| 78 |
endef |
| 79 |
|
| 80 |
export:: $(TARGETS) |
| 81 |
rm -f $(dist_bindir)/nspr-config |
| 82 |
|
| 83 |
ifdef WRAP_SYSTEM_INCLUDES |
| 84 |
export:: |
| 85 |
if test ! -d system_wrappers; then mkdir system_wrappers; fi |
| 86 |
$(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers < $(srcdir)/system-headers |
| 87 |
$(INSTALL) system_wrappers $(dist_includedir) |
| 88 |
endif |
| 89 |
|
| 90 |
$(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX) |
| 91 |
@$(MAKE_OBJDIR) |
| 92 |
$(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@ |
| 93 |
|
| 94 |
install:: nspr.m4 |
| 95 |
$(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal |
| 96 |
$(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal |
| 97 |
|
| 98 |
install:: nspr.pc |
| 99 |
$(NSINSTALL) -D $(DESTDIR)$(libdir)/pkgconfig |
| 100 |
$(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(libdir)/pkgconfig |