# makeLibrary2 - pass two of making libraries
#
# modification history
# --------------------
# 01h,18jun95,srh  added support for actions secondary to primary build in
#		   order to support multiple C++ toolchains on a single
#		   platform.
# 01g,25may95,jcf  new environment variables
# 01f,22nov94,kdl  added .NO_WINK_IN rule for LIBNAME, to suppress ClearCase
#		   winking-in of archives based on current directory only.
# 01e,30sep94,kdl  changed "make" to "$(MAKE)" to use environment variable;
#		   changed depend.$(CPU)$(TOOL) rule to use temporary file.
# 01d,24sep92,yp   switch default dependencies as hack arround time resolution
#		   problem in directories with single files.
# 01c,02sep92,yp   undid 01b. should be in makeLibrary1
# 01b,02sep92,yp   added doc rule
# 01a,27jul92,rrr  added modification history. added release rule
#
# DESCRIPTION
# This file contains pass two of building libraries.
#

include(VX_MAKE/make.defaults)
include(VX_MAKE/make.PASS2)

default:	lib subdirs
	@   if [ x"$(MAKETAIL)" != x ]; then		\
	        ($(MAKE) -f Makefile.$(CPU)$(TOOL)	\
		 $(MAKETAIL)				\
		 MAKETAIL='')				\
	    fi

clean:
	$(RM) $(LIBOBJS)
	@   if [ x"$(CLEANTAIL)" != x ]; then		\
	        ($(MAKE) -f Makefile.$(CPU)$(TOOL)	\
		 $(CLEANTAIL)				\
		 CLEANTAIL='')				\
	    fi

# Clearmake does not correctly handle archives which are built incrementally
# via builds in several directories.  It only considers the derived objects
# created in the current directory when deciding whether to update the
# archive or wink-in (virtually copy) an existing archive from another view.
# As a result, the archive may be clobbered with a version which is only
# correct with respect to the current source directory's files.
# The following rule suppresses winking-in of the target archive:

.NO_WINK_IN: $(UP)lib/$(LIBNAME)


release:
	$(MAKE) -f Makefile.$(CPU)$(TOOL) CPU=$(CPU) TOOL=$(TOOL) \
	TARGET=release default

depend.$(CPU)$(TOOL):
	$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin/mdepend \
	-f Makefile.$(CPU)$(TOOL).tmp  -o Makefile.$(CPU)$(TOOL) \
	$(CC_INCLUDE) $(CC_DEFINES) -- $(SUBDIRS) -- $(OBJS)

# end of makeLibrary2
