6b202f4e3d
to contain headers shared by kernel and userland (mainly libroot). * Moved quite a few private kernel headers to the new location. Split several kernel headers into a shared part and one that is still kernel private. Adjusted all affected Jamfiles and source in the standard x86 build accordingly. The build for other architectures and for test code may be broken. * Quite a bit of userland code still includes private kernel headers. Mostly those are <util/*> headers. The ones that aren't strictly kernel-only should be moved to some other place (maybe headers/private/shared/util). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25486 a95241bf-73f2-0310-859d-f6bbb57e9c96
157 lines
4.1 KiB
Plaintext
157 lines
4.1 KiB
Plaintext
SubDir HAIKU_TOP src tools gensyscalls ;
|
|
|
|
# preprocess the syscalls header
|
|
|
|
rule PreprocessSyscalls
|
|
{
|
|
# PreprocessSyscalls <preprocessedHeader> : <header> : <parsable> ;
|
|
#
|
|
local parsable = $(3) ;
|
|
local parsableDefine ;
|
|
|
|
if $(parsable) {
|
|
parsableDefine = GEN_SYSCALL_INFOS_PROCESSING ;
|
|
}
|
|
|
|
Depends $(<) : $(>) ;
|
|
|
|
local headers = [ on $(1) return $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;
|
|
local sysHeaders =
|
|
$(TARGET_PRIVATE_SYSTEM_HEADERS)
|
|
[ ArchHeaders $(TARGET_ARCH) ]
|
|
[ on $(1) return $(SUBDIRSYSHDRS) $(SYSHDRS) ]
|
|
$(HAIKU_HDRS) ;
|
|
|
|
HDRS on $(<) = $(headers) ;
|
|
SYSHDRS on $(<) = $(sysHeaders) ;
|
|
|
|
HDRRULE on $(>) = HdrRule ;
|
|
HDRSCAN on $(>) = $(HDRPATTERN) ;
|
|
HDRSEARCH on $(>) = $(headers) $(sysHeaders) $(STDHDRS) ;
|
|
HDRGRIST on $(>) = $(HDRGRIST) ;
|
|
|
|
DEFINES on $(<) += $(HAIKU_DEFINES) $(parsableDefine) ;
|
|
|
|
CCFLAGS on $(<) += $(HAIKU_CCFLAGS) $(SUBDIRCCFLAGS) $(OPTIM) ;
|
|
CCHDRS on $(<) = [ FIncludes $(headers) : $(HAIKU_LOCAL_INCLUDES_OPTION) ]
|
|
$(HAIKU_INCLUDES_SEPARATOR)
|
|
[ FSysIncludes $(sysHeaders) : $(HAIKU_SYSTEM_INCLUDES_OPTION) ] ;
|
|
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
|
|
}
|
|
|
|
actions PreprocessSyscalls
|
|
{
|
|
$(HAIKU_C++) -xc++ -E "$(2)" $(CCFLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)" ;
|
|
}
|
|
|
|
local syscallsHeader = [ FGristFiles syscalls.h ] ;
|
|
SEARCH on $(syscallsHeader) = [ FDirName $(HAIKU_TOP) headers private system ] ;
|
|
|
|
# We generate two preprocessed headers. One for parsing by gensyscallinfos
|
|
# (it contains #pragmas) and one for inclusion by the generated
|
|
# gensyscalls_infos.cpp.
|
|
local syscallsHeaderPPParsable = [ FGristFiles syscalls.h.pp.parsable ] ;
|
|
local syscallsHeaderPP = [ FGristFiles syscalls.h.pp ] ;
|
|
MakeLocateArch $(syscallsHeaderPPParsable) $(syscallsHeaderPP) ;
|
|
|
|
PreprocessSyscalls $(syscallsHeaderPPParsable) : $(syscallsHeader) : true ;
|
|
PreprocessSyscalls $(syscallsHeaderPP) : $(syscallsHeader) ;
|
|
|
|
|
|
# build gensyscallinfos
|
|
|
|
BuildPlatformMain gensyscallinfos
|
|
: gensyscallinfos.cpp
|
|
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
|
|
;
|
|
|
|
|
|
# generate the syscall infos source file
|
|
|
|
local syscallInfos = [ FGristFiles gensyscalls_infos.cpp ] ;
|
|
MakeLocateArch $(syscallInfos) ;
|
|
|
|
rule GenSyscallInfos {
|
|
Depends $(1) : gensyscallinfos $(2) ;
|
|
GenSyscallInfos1 $(1) : gensyscallinfos $(2) ;
|
|
}
|
|
|
|
actions GenSyscallInfos1 {
|
|
$(2[1]) $(2[2]) $(1)
|
|
}
|
|
|
|
GenSyscallInfos $(syscallInfos) : $(syscallsHeaderPPParsable) ;
|
|
|
|
SubDirHdrs [ FDirName $(SUBDIR) arch $(TARGET_ARCH) ] ;
|
|
|
|
|
|
# build gensyscalls
|
|
|
|
BuildPlatformMain gensyscalls : gensyscalls.cpp $(syscallInfos) ;
|
|
LinkAgainst gensyscalls : $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
|
|
|
# Explicitly tell jam that gensyscalls.cpp includes the generated header.
|
|
Includes [ FGristFiles gensyscalls.cpp ] : $(syscallsHeaderPP) ;
|
|
|
|
|
|
# generate the output files
|
|
|
|
# place them where they are needed
|
|
local dir = $(HAIKU_COMMON_DEBUG_OBJECT_DIR) ;
|
|
MakeLocate <syscalls>syscalls.S.inc : [ FDirName $(dir) system libroot os ] ;
|
|
MakeLocate <syscalls>syscall_dispatcher.h : [ FDirName $(dir) system kernel ] ;
|
|
MakeLocate <syscalls>syscall_numbers.h : [ FDirName $(dir) system kernel ] ;
|
|
MakeLocate <syscalls>syscall_table.h : [ FDirName $(dir) system kernel ] ;
|
|
MakeLocate <syscalls>strace_syscalls.h : [ FDirName $(dir) bin strace ] ;
|
|
|
|
rule GenSyscallsFile {
|
|
Depends $(1) : gensyscalls ;
|
|
GenSyscallsFile1 $(1) : gensyscalls ;
|
|
}
|
|
|
|
actions GenSyscallsFile1 {
|
|
$(2[1]) -c $(1)
|
|
}
|
|
|
|
rule GenSyscallsDispatcher {
|
|
Depends $(1) : gensyscalls ;
|
|
GenSyscallsDispatcher1 $(1) : gensyscalls ;
|
|
}
|
|
|
|
actions GenSyscallsDispatcher1 {
|
|
$(2[1]) -d $(1)
|
|
}
|
|
|
|
rule GenSyscallsNumbers {
|
|
Depends $(1) : gensyscalls ;
|
|
GenSyscallsNumbers1 $(1) : gensyscalls ;
|
|
}
|
|
|
|
actions GenSyscallsNumbers1 {
|
|
$(2[1]) -n $(1)
|
|
}
|
|
|
|
rule GenSyscallsTable {
|
|
Depends $(1) : gensyscalls ;
|
|
GenSyscallsTable1 $(1) : gensyscalls ;
|
|
}
|
|
|
|
actions GenSyscallsTable1 {
|
|
$(2[1]) -t $(1)
|
|
}
|
|
|
|
rule GenSyscallsSTrace {
|
|
Depends $(1) : gensyscalls ;
|
|
GenSyscallsSTrace1 $(1) : gensyscalls ;
|
|
}
|
|
|
|
actions GenSyscallsSTrace1 {
|
|
$(2[1]) -s $(1)
|
|
}
|
|
|
|
GenSyscallsFile <syscalls>syscalls.S.inc ;
|
|
GenSyscallsDispatcher <syscalls>syscall_dispatcher.h ;
|
|
GenSyscallsNumbers <syscalls>syscall_numbers.h ;
|
|
GenSyscallsTable <syscalls>syscall_table.h ;
|
|
GenSyscallsSTrace <syscalls>strace_syscalls.h ;
|