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