1SubDir HAIKU_TOP src bin debug strace ; 2 3UsePrivateHeaders device ; 4UsePrivateHeaders drivers ; 5UsePrivateHeaders libroot ; 6UsePrivateHeaders shared ; 7UsePrivateHeaders net ; 8UsePrivateSystemHeaders ; 9 10SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) ] ; 11 12# find headers generated by gensyscalls 13SubDirHdrs $(TARGET_COMMON_DEBUG_LOCATE_TARGET) ; 14 15local straceSources = 16 strace.cpp 17 18 Context.cpp 19 TypeHandler.cpp 20 NetworkTypes.cpp 21 MemoryReader.cpp 22 23 area.cpp 24 fcntl.cpp 25 ioctl.cpp 26 network.cpp 27; 28 29# Our compiler badly chokes when compiling the generated file. So will 30# split up the job into 20 pieces. 31local straceSyscallsIndices 32 = 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; 33 34local straceSyscallsSource = [ FGristFiles strace_syscalls.cpp ] ; 35local straceSyscallsObjects ; 36 37local i ; 38for i in $(straceSyscallsIndices) { 39 local object = [ FGristFiles strace_syscalls$(i).o ] ; 40 straceSyscallsObjects += $(object) ; 41 42 # Whatever our compiler (gcc 2.95.3) thinks it is doing when compiling the 43 # generated files, it really takes it time when optimization is enabled. 44 # A lot with -O1, even more with -O2. Also the object sizes are amazing. 45 # -O0 fares significantly better; at least speed-wise. I would almost think 46 # about reverting to compiling all in one object file again. Almost... 47 OPTIM on $(object) = -O0 ; 48 49 Object $(object) : $(straceSyscallsSource) ; 50 51 ObjectDefines $(object) 52 : GET_SYSCALLS=get_syscalls$(i) SYSCALLS_CHUNK_$(i) ; 53} 54 55BinCommand strace : $(straceSources) 56 : 57 $(straceSyscallsObjects) 58 <bin>debug_utils.a 59 [ TargetLibstdc++ ] 60; 61 62# We need to specify the dependency on the generated syscalls file explicitly. 63Includes $(straceSyscallsSource) 64 : <syscalls!$(TARGET_PACKAGING_ARCH)>strace_syscalls.h ; 65