added sample rule to check gcc version
[k8jam.git] / defaults / main / Jambase.main.cpp
blob860df0844fd0fb91d30acb624388e682f7348ef5
1 # /C++Main image : sources ;
3 # Compiles _sources_ and links them into _image_. Calls @Objects and
4 # @C++MainFromObjects.
6 # _image_ may be supplied without suffix.
8 rule C++Main {
9 C++MainFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
10 Objects $(>) ;
14 # /C++MainFromObjects image : objects ;
16 # Links _objects_ into _image_. Dependency of exe.
17 # @MainFromObjects provides a default suffix for _image_
19 rule C++MainFromObjects {
20 local _s _t ;
22 # Add grist to file names
23 # Add suffix to exe
24 _s = [ FGristFiles $(>) ] ;
25 _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;
26 # so 'jam foo' works when it's really foo.exe
28 if $(_t) != $(<) {
29 Depends $(<) : $(_t) ;
30 NotFile $(<) ;
33 # make compiled sources a dependency of target
34 Depends exe : $(_t) ;
35 Depends $(_t) : $(_s) ;
36 #k8:MakeLocate $(_t) : $(LOCATE_TARGET) ;
37 MakeLocate $(_t) : $(LOCATE_BIN) ;
38 Clean clean : $(_t) ;
40 # special case for stupid Borland C++, which always generates a
41 # .tds file for executables, even when no debug information is needed
43 #if $(JAM_TOOLSET) = BORLANDC {
44 # MakeLocate $(_t:S=.tds) : $(LOCATE_TARGET) ;
45 # Clean clean : $(_t:S=.tds) ;
48 C++Link $(_t) : $(_s) ; ###k8:FIXME
52 rule ObjC-MainFromObjects {
53 local _s _t ;
55 # Add grist to file names
56 # Add suffix to exe
57 _s = [ FGristFiles $(>) ] ;
58 _t = [ FAppendSuffix $(<) : $(SUFEXE) ] ;
59 # so 'jam foo' works when it's really foo.exe
61 if $(_t) != $(<) {
62 Depends $(<) : $(_t) ;
63 NotFile $(<) ;
66 # make compiled sources a dependency of target
67 Depends exe : $(_t) ;
68 Depends $(_t) : $(_s) ;
69 #k8:MakeLocate $(_t) : $(LOCATE_TARGET) ;
70 MakeLocate $(_t) : $(LOCATE_BIN) ;
71 Clean clean : $(_t) ;
73 ObjC-Link $(_t) : $(_s) ; ###k8:FIXME