Nokia Networks Home

Nokia nmake Product Builder

Quick Links

Related Products

How to do the library closure with Lucent C++ 5.x?

Lucent C++ 5.0 contains a new command for maintaining template archive libraries called CCar. The below libclose5.mk rules allows C++ 5.0 template archives to be easily built and incrementally maintained when using nmake. See the CCar(1) man page for details.

Typical usage is as follows:

    include libclose5.mk

    CC = CC
    CFILES = a.c b.c c.c

    libsub.a :: $(CFILES)

You may download libclose5.mk, the rules are as follows:

    /* libclose5.mk
       Rules for library maintenance and closure using Lucent C++ 5.0
       using --one_instantiation_per_object mode
    */

    /* set to --one_instantiation_per_object for separate instantiation */
    INSTANTIATIONMODE = --one_instantiation_per_object 

    /* remove template instantiation files */
    /* remove library-specific Makefile products */
    .CLOBBER. += $$(".":L=*.ti)

    INSTANTIATIONDIR = Template.dir
    CCAR = CCar
    CCARFLAGS =

    .CLOBBER : .CLOBBER.PRELINK

    .CLOBBER.PRELINK : .VIRTUAL .FORCE .REPEAT .AFTER
	    $(INSTANTIATIONDIR:T=F:P=L:?$(IGNORE) $(RM) $(RMFLAGS) -r $(INSTANTIATIONDIR:T=F:P=L)??)

    .MAKEINIT : .ARINIT

    .ARINIT : .MAKE .VIRTUAL .FORCE .AFTER
	    CCFLAGS += $(INSTANTIATIONMODE)

    .ARCHIVE.o : .CLEAR .USE (CC) (CCAR) (CCARFLAGS) (AR)
	    set +x
	    (
	    artm=${TMPDIR:-/tmp}/artm$COTEMP
	    trap 'set +x $?; trap "" 0; rm -f $artm;
		  exit ${1:-3}' 0 HUP INT QUIT TERM
	    echo "$(*:A!=.ARCHIVE) -- $(*:A!=.ARCHIVE:T=SR:T=R)" >$artm
	    $(-silent:??set -x?)
	    $(CCAR) $(CCARFLAGS) -u $artm -o $(<) $(*:A!=.ARCHIVE) $(*:A=.ARCHIVE:@?--??) $(*:A=.ARCHIVE)
	    )

    .ATTRIBUTE.%.a : -ARCHIVE
Last Update: Friday,12-Aug-2016 10:43:48 EDT