3 # returns "_" for 'selftarget'
4 rule --MainNormalizeTargets-- {
6 if ! $(_ctt) { _ctt = exe ; }
7 else if $(_ctt) = $(1) { _ctt = "_" ; }
12 # /--MainFromObjects-- image : objects : targets : linkrule : origlist ;
14 # Links _objects_ into _image_. Dependency of exe.
15 # @MainFromObjects provides a default suffix for _image_
17 rule --MainFromObjects-- {
18 local _s _t _ctt _f have_attrs _xl ;
21 # check if we have attributes
30 # Add grist to file names
32 # rebuild list removing any attributes
36 if ! ( $(_f) ~= '^![^!]' ) {
39 _f = [ Match '^!([^\s]+)' : $(_f) ] ;
42 if $(lastfile) { _s += $(lastfile) ; }
43 lastfile = [ FGristFiles $(_f) ] ;
45 #Echo "NOT-FILE:" $(_f) ;
46 if $(_f:S=) = "!dont-link" { lastfile = ; }
49 if $(lastfile) { _s += $(lastfile) ; }
51 _s = [ FGristFiles $(>) ] ;
53 _s = [ ListRemoveDuplicates $(_s) ] ;
59 _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;
60 # so 'jam foo' works when it's really foo.exe
62 Depends $(<) : $(_t) ;
66 #Echo "MainFromObjects: _t:" "$(_t)" "_ctt:" "$(_ctt)" ;
68 # make compiled sources a dependency of target
71 #Echo "separate target:" "$(_f)" ;
72 Depends $(_f) : $(_t) ;
73 Clean $(_f)_clean : $(_t) ;
74 Depends $(_f)_clean : clean ;
77 #Echo "separate target:" "$(_t)" ;
78 Clean $(_t)_clean : $(_t) ;
79 Depends $(_t)_clean : clean ;
81 #Depends exe : $(_t) ;
82 Depends $(_t) : $(_s) ;
83 #k8:MakeLocate $(_t) : $(LOCATE_TARGET) ;
84 MakeLocate $(_t) : $(LOCATE_BIN) ;
87 # special case for stupid Borland C++, which always generates a
88 # .tds file for executables, even when no debug information is needed
90 #if $(JAM_TOOLSET) = BORLANDC {
91 # MakeLocate $(_t:S=.tds) : $(LOCATE_TARGET) ;
92 # Clean clean : $(_t:S=.tds) ;
98 # some files have some special attributes, process this
99 _s = ; # last file met, gristed
100 _t = ; # last file met, unmodified
103 _ctt = [ Match '^!([^!][^\s]+)' : $(_f) ] ;
107 #Echo "ATTR:" $(_ctt) "for file:" $(_s) "ungristed:" $(_t) ;
108 if $(_ctt) != "dont-link" {
109 if [ HaveRule --main-option-$(_ctt)-- ] {
110 --main-option-$(_ctt)-- $(_s) : $(_t) ;
112 Exit "FATAL: invalid attribute" $(_ctt) "for file" $(_t) ;
118 _f = [ Match '^!([^\s]+)' : $(_f) ] ;
123 _s = [ FGristFiles $(_f:S=$(SUFOBJ)) ] ;
133 . main/Jambase.main.c
134 . main/Jambase.main.cpp
135 . main/Jambase.main.objc
136 . main/Jambase.main.lib
137 . main/Jambase.main.libso
138 . main/Jambase.main.libboth