Don't crash if we've got an invalid data.
[tairent.git] / Jamrules
blobde178f37d502555ef131471bec6a62072fbaa5ab
1 BINDIR = $(TOP)/bin ;
2 MODDIR = $(TOP)/modules ;
4 AR = "ar cr" ;
5 C++ = g++ ;
6 CC = $(C++) ;
7 LINK = g++ ;
8 PYTHON = python ;
10 LIBSDIR = "/usr/local/lib/tairon" ;
12 C++FLAGS = -Wall -pipe -g -fPIC ;
13 DEFINES = _REENTRANT LOGLEVEL=3 TIXML_USE_STL ;
14 HDRS = ;
15 OPTIM = ;
16 SHAREDFLAG = -shared ;
17 LINKFLAGS = -Wl,--export-dynamic ;
20 rule BuildLibrary
22         BuildLibraryObjects $(<) : $(>:S=$(SUFOBJ)) ;
23         Objects $(>) ;
26 rule BuildLibraryObjects
28         local s ;
29         s = [ FGristFiles $(>) ] ;
30         l = $(<:S=$(SUFLIB)) ;
32         Depends $(l) : $(s) ;
34         if ! $(l:D) {
35                 MakeLocate $(l) $(l)$($(s:BS)) : $(LOCATE_TARGET) ;
36         }
38         Clean clean : $(l) ;
40         Archive $(l) : $(s) ;
42         if $(RANLIB) {
43                 Ranlib $(l) ;
44         }
47 rule C++
49         Depends $(<) : $(>) ;
51         if $(RELOCATE)
52         {
53                 CcMv $(<) : $(>) ;
54         }
56         C++FLAGS on $(<) += $(C++FLAGS) $(SUBDIRC++FLAGS) $(OPTIM) ;
58         # Include only specified headers.
59         CCHDRS on $(<) += [ on $(<) FIncludes $(HEADERS) ] ;
60         CCDEFS on $(<) += [ on $(<) FDefines $(DEFINES) ] ;
63 rule Main
65         # This ensures that flags used to link this target also uses the ones from
66         # above
67         LINKFLAGS on $(<) += $(LINKFLAGS) ;
68         LINKFLAGS on $(<) += [ on $(<) FLibrariesDir $(LIBSDIR) ] ;
69         LINKFLAGS on $(<) += [ on $(<) FLibraries $(SHAREDLIBS) ] ;
70         MainFromObjects $(<) : $(>:S=$(SUFOBJ)) ;
71         Objects $(>) ;
74 rule Python
76         Clean clean : $(<) ;
78         SEARCH on $(>) = $(SEARCH_SOURCE) ;
79         MakeLocate $(<) : $(LOCATE_TARGET) ;
80         Depends $(<) : $(>) ;
83 rule Shared
85         LINKFLAGS on $(<) += $(SHAREDFLAG) ;
86         Main $(<) : $(>) ;
89 rule FLibraries
91         return -l$(<) ;
94 rule FLibrariesDir
96         return -L$(<) ;
99 actions Python
101         $(PYTHON) $(>) $(<)
104 # vim: syntax=jam ai sw=4 ts=4 noet fdm=marker