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: michael@0: #! gmake 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: include $(topsrcdir)/config/config.mk michael@0: michael@0: INCLUDES = -I$(dist_includedir) michael@0: michael@0: CSRCS =\ michael@0: plvrsion.c \ michael@0: strlen.c \ michael@0: strcpy.c \ michael@0: strdup.c \ michael@0: strcase.c \ michael@0: strcat.c \ michael@0: strcmp.c \ michael@0: strchr.c \ michael@0: strpbrk.c \ michael@0: strstr.c \ michael@0: strtok.c \ michael@0: base64.c \ michael@0: plerror.c \ michael@0: plgetopt.c \ michael@0: $(NULL) michael@0: michael@0: LIBRARY_NAME = plc michael@0: LIBRARY_VERSION = $(MOD_MAJOR_VERSION) michael@0: michael@0: RELEASE_LIBS = $(TARGETS) michael@0: michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: RES=$(OBJDIR)/plc.res michael@0: RESNAME=plc.rc michael@0: endif # WINNT michael@0: michael@0: ifeq ($(OS_ARCH), AIX) michael@0: ifeq ($(CLASSIC_NSPR),1) michael@0: OS_LIBS = -lc michael@0: else michael@0: OS_LIBS = -lc_r michael@0: endif michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),IRIX) michael@0: OS_LIBS = -lc michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),SunOS) michael@0: OS_LIBS = -lc michael@0: MAPFILE = $(OBJDIR)/plcmap.sun michael@0: GARBAGE += $(MAPFILE) michael@0: ifdef NS_USE_GCC michael@0: ifdef GCC_USE_GNU_LD michael@0: MKSHLIB += -Wl,--version-script,$(MAPFILE) michael@0: else michael@0: MKSHLIB += -Wl,-M,$(MAPFILE) michael@0: endif michael@0: else michael@0: MKSHLIB += -M $(MAPFILE) michael@0: endif michael@0: # The -R '$ORIGIN' linker option instructs this library to search for its michael@0: # dependencies in the same directory where it resides. michael@0: MKSHLIB += -R '$$ORIGIN' michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH),OS2) michael@0: MAPFILE = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).def michael@0: GARBAGE += $(MAPFILE) michael@0: MKSHLIB += $(MAPFILE) michael@0: endif michael@0: michael@0: EXTRA_LIBS = $(LIBNSPR) michael@0: michael@0: # On SCOOS, we can't link with extra libraries when michael@0: # we build a shared library. If we do so, the linker doesn't michael@0: # complain, but we would run into weird problems at run-time. michael@0: # Therefore on these platforms, we link just the .o files. michael@0: ifeq ($(OS_ARCH),SCOOS) michael@0: EXTRA_LIBS = michael@0: endif michael@0: michael@0: ifdef RESOLVE_LINK_SYMBOLS michael@0: EXTRA_LIBS += $(OS_LIBS) michael@0: endif michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: # michael@0: # Version information generation (begin) michael@0: # michael@0: ECHO = echo michael@0: TINC = $(OBJDIR)/_pl_bld.h michael@0: PROD = $(notdir $(SHARED_LIBRARY)) michael@0: NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now michael@0: SH_DATE = $(shell date "+%Y-%m-%d %T") michael@0: SH_NOW = $(shell $(NOW)) michael@0: michael@0: ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) michael@0: SUF = i64 michael@0: else michael@0: SUF = LL michael@0: endif michael@0: michael@0: GARBAGE += $(TINC) michael@0: michael@0: $(TINC): michael@0: @$(MAKE_OBJDIR) michael@0: @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC) michael@0: @if test ! -z "$(SH_NOW)"; then \ michael@0: $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \ michael@0: else \ michael@0: true; \ michael@0: fi michael@0: @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC) michael@0: michael@0: michael@0: $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC) michael@0: ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) michael@0: $(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $< michael@0: else michael@0: $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $< michael@0: endif michael@0: # michael@0: # Version information generation (end) michael@0: # michael@0: michael@0: # michael@0: # The Client build wants the shared libraries in $(dist_bindir), michael@0: # so we also install them there. michael@0: # michael@0: michael@0: export:: $(TARGETS) michael@0: $(INSTALL) -m 444 $(TARGETS) $(dist_libdir) michael@0: ifdef SHARED_LIBRARY michael@0: ifeq ($(OS_ARCH),HP-UX) michael@0: $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir) michael@0: $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_bindir) michael@0: else michael@0: $(INSTALL) -m 444 $(SHARED_LIBRARY) $(dist_bindir) michael@0: endif michael@0: endif