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