1 #============================================================================
2 # Rules for C and C++ files
3 #============================================================================
12 if [ IsElem shared : $(2) ]
14 object = [ LocateTarget $(<:S=.lo) ] ;
15 CC on $(object) = "$(LIBTOOL) --mode=compile $(CC)" ;
17 object = [ LocateTarget $(<:S=.o) ] ;
20 CFLAGS on $(object) = $(CFLAGS) ;
21 CPPFLAGS on $(object) = $(CPPFLAGS) ;
23 Depends $(object) : $(<) ;
27 RegisterFileType CcRule : .c ;
28 RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .c ;
32 $(CC) -c -o $(<) $(CPPFLAGS) $(CFLAGS) $(>)
43 if [ IsElem shared : $(2) ] {
44 object = [ LocateTarget $(<:S=.lo) ] ;
45 CXX on $(object) = "$(LIBTOOL) --mode=compile $(CXX)" ;
47 object = [ LocateTarget $(<:S=.o) ] ;
49 CXXFLAGS on $(object) = $(CXXFLAGS) ;
50 CPPFLAGS on $(object) = $(CPPFLAGS) ;
51 C++ $(object) : $(<) ;
52 Depends $(object) : $(<) ;
55 RegisterFileType C++Rule : .cpp .cc .c++ ; # we can't register .C here because
56 # of windows being case-insensitive.
57 RegisterHeaderRule HeaderRule : $(HDRPATTERN) : .cpp .cc .c++ ;
61 $(CXX) -c -o $(<) $(CPPFLAGS) $(CXXFLAGS) $(>)
65 rule CreateIncludeFlags
70 rule CreateDefineFlags