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: # only do this in the outermost freebl build. michael@0: ifndef FREEBL_CHILD_BUILD michael@0: michael@0: # We're going to change this build so that it builds libfreebl.a with michael@0: # just loader.c. Then we have to build this directory twice again to michael@0: # build the two DSOs. michael@0: # To build libfreebl.a with just loader.c, we must now override many michael@0: # of the make variables setup by the prior inclusion of CORECONF's config.mk michael@0: michael@0: CSRCS = loader.c michael@0: SIMPLE_OBJS = $(CSRCS:.c=$(OBJ_SUFFIX)) michael@0: OBJS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), $(SIMPLE_OBJS)) michael@0: ALL_TRASH := $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \ michael@0: $(NOSUCHFILE) so_locations michael@0: michael@0: # this is not a recursive child make. We make a static lib. (archive) michael@0: michael@0: # Override the values defined in coreconf's ruleset.mk. michael@0: # michael@0: # - (1) LIBRARY: a static (archival) library michael@0: # - (2) SHARED_LIBRARY: a shared (dynamic link) library michael@0: # - (3) IMPORT_LIBRARY: an import library, used only on Windows michael@0: # - (4) PROGRAM: an executable binary michael@0: # michael@0: # override these variables to prevent building a DSO/DLL. michael@0: TARGETS = $(LIBRARY) michael@0: SHARED_LIBRARY = michael@0: IMPORT_LIBRARY = michael@0: PROGRAM = michael@0: michael@0: else michael@0: michael@0: # This is a recursive child make. We build the shared lib. michael@0: michael@0: TARGETS = $(SHARED_LIBRARY) michael@0: LIBRARY = michael@0: IMPORT_LIBRARY = michael@0: PROGRAM = michael@0: michael@0: ifeq ($(OS_TARGET), SunOS) michael@0: OS_LIBS += -lkstat michael@0: endif michael@0: michael@0: ifeq (,$(filter-out WIN%,$(OS_TARGET))) michael@0: michael@0: # don't want the 32 in the shared library name michael@0: SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) michael@0: michael@0: RES = $(OBJDIR)/$(LIBRARY_NAME).res michael@0: RESNAME = freebl.rc michael@0: michael@0: ifdef NS_USE_GCC michael@0: OS_LIBS += -ladvapi32 michael@0: else michael@0: OS_LIBS += advapi32.lib michael@0: endif michael@0: michael@0: ifdef NS_USE_GCC michael@0: EXTRA_SHARED_LIBS += \ michael@0: -L$(DIST)/lib \ michael@0: -L$(NSSUTIL_LIB_DIR) \ michael@0: -lnssutil3 \ michael@0: -L$(NSPR_LIB_DIR) \ michael@0: -lnspr4 \ michael@0: $(NULL) michael@0: else # ! NS_USE_GCC michael@0: EXTRA_SHARED_LIBS += \ michael@0: $(DIST)/lib/nssutil3.lib \ michael@0: $(NSPR_LIB_DIR)/$(NSPR31_LIB_PREFIX)nspr4.lib \ michael@0: $(NULL) michael@0: endif # NS_USE_GCC michael@0: michael@0: else michael@0: michael@0: ifeq ($(FREEBL_NO_DEPEND),1) michael@0: #drop pthreads as well michael@0: OS_PTHREAD= michael@0: else michael@0: EXTRA_SHARED_LIBS += \ michael@0: -L$(DIST)/lib \ michael@0: -L$(NSSUTIL_LIB_DIR) \ michael@0: -lnssutil3 \ michael@0: -L$(NSPR_LIB_DIR) \ michael@0: -lnspr4 \ michael@0: $(NULL) michael@0: endif michael@0: endif michael@0: michael@0: ifeq ($(OS_ARCH), Darwin) michael@0: EXTRA_SHARED_LIBS += -dylib_file @executable_path/libplc4.dylib:$(DIST)/lib/libplc4.dylib -dylib_file @executable_path/libplds4.dylib:$(DIST)/lib/libplds4.dylib michael@0: endif michael@0: michael@0: endif