1 # /Library library : sources ;
3 # Compiles _sources_ and archives them into _library_. The intermediate
4 # objects are deleted. Calles @Object and @LibraryFromObjects
6 # If @Library is invoked with no suffix on _library_, the $(SUFLIB)
10 LibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
11 Objects $(>) : : $(1) ;
15 ######################################################
17 ######################################################
18 #!LIBTOOL!#if $(UNIX) {
19 #!LIBTOOL!# # this rule is used to find the 'libtool' script in the current
20 #!LIBTOOL!# # path, this is required when compiling shared objects on Unix
21 #!LIBTOOL!# rule LibToolFind {
22 #!LIBTOOL!# if $(LIBTOOL) { return $(LIBTOOL) ; }
23 #!LIBTOOL!# local matches = [ Glob $(PATH) : libtool ] ;
24 #!LIBTOOL!# if ! $(matches) { Exit "could not find 'libtool' program in current path. Aborting !" ; }
25 #!LIBTOOL!# LIBTOOL = $(matches[1]) ;
26 #!LIBTOOL!# return $(LIBTOOL) ;
31 # /LibraryFromObjects library : objects ;
33 # Archives _objects_ into _library_. The _objects_ are then deleted
35 # If _library_ has no suffix, the $(SUFLIB) suffix is used
37 # Called by @Library rule. Most people should never call this rule
40 rule LibraryFromObjects {
43 # Add grist to file names
44 _s = [ FGristFiles $(>) ] ;
45 _l = $(<:S=$(SUFLIB)) ;
47 # library depends on its member objects
54 # Set LOCATE for the library and its contents. The bound
55 # value shows up as $(NEEDLIBS) on the Link actions.
56 # For compatibility, we only do this if the library doesn't
57 # already have a path.
59 #!!MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_TARGET) ;
60 MakeLocate $(_l) $(_l)($(_s:BS)) : $(LOCATE_LIB) ;
64 # If we can't scan the library to timestamp its contents,
65 # we have to just make the library depend directly on the
66 # on-disk object files.
67 Depends $(_l) : $(_s) ;
69 # If we can scan the library, we make the library depend
70 # on its members and each member depend on the on-disk
72 Depends $(_l) : $(_l)($(_s:BS)) ;
74 Depends $(_l)($(_i:BS)) : $(_i) ;
80 if $(CRELIB) { CreLib $(_l) : $(_s[1]) ; }
82 Archive $(_l) : $(_s) ;
84 if $(RANLIB) { Ranlib $(_l) ; }
86 # If we can't scan the library, we have to leave the .o's around.
87 if ! ( $(NOARSCAN) || $(NOARUPDATE) ) { RmTemps $(_l) : $(_s) ; }