1SubDir OBOS_TOP src libs stdc++ ; 2 3local savedCcFlags = $(CCFLAGS) ; 4CCFLAGS = ; 5local savedC++Flags = $(C++FLAGS) ; 6C++FLAGS = ; 7 8# define header-searchpaths all by ourselves, as including system headers 9# messes things up: 10# use the following paths to make use of the headers contained in glibc, 11# but this doesn't work yet, as the libio we are using here and the one 12# contained in our libroot are different versions. 13HDRS = 14 [ FDirName $(OBOS_TOP) src kernel libroot posix glibc libio ] 15 [ FDirName $(OBOS_TOP) src kernel libroot posix glibc stdlib ] 16 [ FDirName $(OBOS_TOP) src kernel libroot posix glibc stdio-common ] 17 [ FDirName $(OBOS_TOP) src kernel libroot posix glibc include ] 18 [ FDirName $(OBOS_TOP) src kernel libroot posix glibc include arch x86 ] 19 [ FDirName $(OBOS_TOP) headers cpp ] 20 [ FDirName $(OBOS_TOP) src kernel libroot posix glibc ] 21 [ FDirName $(OBOS_TOP) headers posix ] 22 [ FDirName $(OBOS_TOP) headers os ] 23 [ FDirName $(OBOS_TOP) headers os kernel ] 24 [ FDirName $(OBOS_TOP) headers os storage ] 25 [ FDirName $(OBOS_TOP) headers os support ] 26 $(LIBGCC_DIR)/include ; # such that include_next will work 27 28# some source-files generate several different objects, depending on 29# the defines that are used during the compilation call. 30# So we explicitly state each of these (with their respective defines): 31rule GenerateStdC++Object 32{ 33 # GenerateStdC++Object <object> : <source> : <defines> ; 34 local object = [ FGristFiles $(1) ] ; 35 local sources = $(2) ; 36 local defines = $(3) ; 37 38 local source ; 39 40 for source in [ FGristFiles $(sources) ] { 41 CCFLAGS on $(source:S=$(SUFOBJ)) = $(savedCcFlags) -Wno-missing-prototypes ; 42 C++FLAGS on $(source:S=$(SUFOBJ)) = $(savedC++Flags) -nostdinc++ -fno-implicit-templates 43 -Wno-sign-compare -fpic ; 44 } 45 46 SetupObjectsDir ; 47 MakeLocateObjects $(object) ; 48 if $(object) { 49 Object $(object) : $(sources) ; 50 } else { 51 Objects $(sources) ; 52 } 53 if $(defines) { 54 if $(object) { 55 ObjectDefines $(object) : $(defines) ; 56 } else { 57 ObjectDefines $(sources) : $(defines) ; 58 } 59 } 60} 61 62GenerateStdC++Object cstrio.o 63 : sinst.cc 64 : C EXTRACT INSERT GETLINE 65 ; 66 67GenerateStdC++Object cstrmain.o 68 : sinst.cc 69 : C REP MAIN TRAITS ADDSS ADDPS ADDCS ADDSP ADDSC EQSS EQPS EQSP NESS NEPS 70 NESP LTSS LTPS LTSP GTSS GTPS GTSP LESS LEPS LESP GESS GEPS GESP ; 71 72GenerateStdC++Object dcomio.o 73 : cinst.cc 74 : D EXTRACT INSERT ; 75 76GenerateStdC++Object dcomplex.o 77 : cinst.cc 78 : D MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC DIVCF 79 DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ NORM COS 80 COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT ; 81 82GenerateStdC++Object fcomio.o 83 : cinst.cc 84 : F EXTRACT INSERT ; 85 86GenerateStdC++Object fcomplex.o 87 : cinst.cc 88 : F MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC DIVCF 89 DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ NORM COS 90 COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT ; 91 92GenerateStdC++Object ldcomio.o 93 : cinst.cc 94 : LD EXTRACT INSERT ; 95 96GenerateStdC++Object ldcomplex.o 97 : cinst.cc 98 : LD MAIN ADDCC ADDCF ADDFC SUBCC SUBCF SUBFC MULCC MULCF MULFC DIVCC DIVCF 99 DIVFC PLUS MINUS EQCC EQCF EQFC NECC NECF NEFC ABS ARG POLAR CONJ NORM COS 100 COSH EXP LOG POWCC POWCF POWCI POWFC SIN SINH SQRT ; 101 102# generate standard objects through our new rule, too: 103GenerateStdC++Object 104 : cmathi.cc 105 cstdlibi.cc 106 cstringi.cc 107 stdexcepti.cc ; 108 109# c++ parts from libio: 110GenerateStdC++Object 111 : builtinbuf.cc 112 editbuf.cc 113 filebuf.cc 114 fstream.cc 115 indstream.cc 116 ioassign.cc 117 ioextend.cc 118 iomanip.cc 119 iostream.cc 120 isgetline.cc 121 isgetsb.cc 122 isscan.cc 123 osform.cc 124 parsestream.cc 125 pfstream.cc 126 PlotFile.cc 127 procbuf.cc 128 sbform.cc 129 sbgetline.cc 130 sbscan.cc 131 SFile.cc 132 stdexcepti.cc 133 stdiostream.cc 134 stdstrbufs.cc 135 stdstreams.cc 136 stlinst.cc 137 stream.cc 138 streambuf.cc 139 strstream.cc ; 140 141# stuff imported from libiberty: 142GenerateStdC++Object 143 : basename.c getpagesize.c insque.c sigsetmask.c strerror.c vfork.c ; 144 145SharedLibraryFromObjects stdc++.r4.so : 146 basename.o 147 builtinbuf.o 148 cmathi.o 149 cstdlibi.o 150 cstringi.o 151 cstrio.o 152 cstrmain.o 153 dcomio.o 154 dcomplex.o 155 editbuf.o 156 fcomio.o 157 fcomplex.o 158 filebuf.o 159 fstream.o 160 getpagesize.o 161 indstream.o 162 insque.o 163 ioassign.o 164 ioextend.o 165 iomanip.o 166 iostream.o 167 isgetline.o 168 isgetsb.o 169 isscan.o 170 ldcomio.o 171 ldcomplex.o 172 osform.o 173 parsestream.o 174 pfstream.o 175 PlotFile.o 176 procbuf.o 177 sbform.o 178 sbgetline.o 179 sbscan.o 180 SFile.o 181 sigsetmask.o 182 stdexcepti.o 183 stdiostream.o 184 stdstrbufs.o 185 stdstreams.o 186 stlinst.o 187 stream.o 188 streambuf.o 189 strerror.o 190 strstream.o 191 vfork.o ; 192 193CCFLAGS = $(savedCcFlags) ; 194C++FLAGS = $(savedC++Flags) ; 195