michael@0: #! gmake michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: MOD_DEPTH = .. michael@0: topsrcdir = @top_srcdir@ michael@0: srcdir = @srcdir@ michael@0: VPATH = @srcdir@ michael@0: michael@0: include $(MOD_DEPTH)/config/autoconf.mk michael@0: michael@0: # Indicate that this directory builds build tools. michael@0: INTERNAL_TOOLS = 1 michael@0: michael@0: # For sanity's sake, we compile nsinstall without the wrapped system michael@0: # headers, so that we can use it to set up the wrapped system headers. michael@0: VISIBILITY_FLAGS = michael@0: michael@0: # autoconf.mk must be deleted last (from the top-level directory) michael@0: # because it is included by every makefile. michael@0: DIST_GARBAGE = nsprincl.mk nsprincl.sh nspr-config nspr.pc michael@0: michael@0: RELEASE_BINS = nspr-config michael@0: michael@0: include $(topsrcdir)/config/config.mk michael@0: michael@0: CSRCS = now.c michael@0: michael@0: # This version hasn't been ported for us; the one in mozilla/config has michael@0: ifneq ($(OS_ARCH),OS2) michael@0: CSRCS += nsinstall.c michael@0: michael@0: PLSRCS = nfspwd.pl michael@0: endif michael@0: michael@0: ifeq (,$(CROSS_COMPILE)$(filter-out WINNT OS2,$(OS_ARCH))) michael@0: PROG_SUFFIX = .exe michael@0: else michael@0: PROG_SUFFIX = michael@0: endif michael@0: michael@0: # Temporary workaround to disable the generation of michael@0: # library build time because now.c uses the 'long long' michael@0: # data type that's not available on some platforms. michael@0: ifeq (,$(filter-out QNX SCOOS UNIXWARE,$(OS_ARCH))) michael@0: DEFINES += -DOMIT_LIB_BUILD_TIME michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH), IRIX) michael@0: ifeq ($(basename $(OS_RELEASE)),6) michael@0: ifndef NS_USE_GCC michael@0: ifeq ($(USE_N32),1) michael@0: XLDOPTS += -n32 -Wl,-woff,85 michael@0: else michael@0: ifeq ($(USE_64),1) michael@0: XLDOPTS += -64 michael@0: else michael@0: XLDOPTS += -32 michael@0: endif michael@0: endif michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH), HP-UX) michael@0: ifeq ($(USE_64),1) michael@0: XLDOPTS += +DD64 michael@0: endif michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH), OS2) michael@0: XCFLAGS = $(OS_CFLAGS) michael@0: endif michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: PROGS = $(OBJDIR)/now$(PROG_SUFFIX) michael@0: michael@0: ifeq (,$(CROSS_COMPILE)$(filter-out OS2 WINNT,$(OS_ARCH))) michael@0: TARGETS = $(PROGS) michael@0: else michael@0: ifeq (,$(filter-out SYMBIAN WINCE,$(OS_ARCH))) michael@0: TARGETS = $(PROGS) michael@0: else michael@0: PROGS += $(OBJDIR)/nsinstall$(PROG_SUFFIX) michael@0: TARGETS = $(PROGS) $(PLSRCS:.pl=) michael@0: endif michael@0: endif michael@0: michael@0: OUTOPTION = -o # end of the line michael@0: ifeq (,$(filter-out WINNT WIN95 WINCE,$(OS_TARGET))) michael@0: ifndef NS_USE_GCC michael@0: OUTOPTION = -Fe michael@0: endif michael@0: endif michael@0: michael@0: # Redefine MAKE_OBJDIR for just this directory michael@0: define MAKE_OBJDIR michael@0: if test ! -d $(@D); then rm -rf $(@D); mkdir $(@D); else true; fi michael@0: endef michael@0: michael@0: export:: $(TARGETS) michael@0: rm -f $(dist_bindir)/nspr-config michael@0: michael@0: ifdef WRAP_SYSTEM_INCLUDES michael@0: export:: michael@0: if test ! -d system_wrappers; then mkdir system_wrappers; fi michael@0: $(PERL) $(srcdir)/make-system-wrappers.pl system_wrappers < $(srcdir)/system-headers michael@0: $(INSTALL) system_wrappers $(dist_includedir) michael@0: endif michael@0: michael@0: $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX) michael@0: @$(MAKE_OBJDIR) michael@0: $(CC) $(XCFLAGS) $< $(LDFLAGS) $(XLDOPTS) $(OUTOPTION)$@ michael@0: michael@0: install:: nspr.m4 michael@0: $(NSINSTALL) -D $(DESTDIR)$(datadir)/aclocal michael@0: $(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(datadir)/aclocal michael@0: michael@0: install:: nspr.pc michael@0: $(NSINSTALL) -D $(DESTDIR)$(libdir)/pkgconfig michael@0: $(NSINSTALL) -t -m 0644 $< $(DESTDIR)$(libdir)/pkgconfig