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