2005-10-29 20:27:43 +04:00
|
|
|
SubDir HAIKU_TOP src tools gensyscalls ;
|
2004-08-22 04:06:00 +04:00
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
# preprocess the syscalls header
|
2004-08-29 00:26:52 +04:00
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
rule PreprocessSyscalls
|
|
|
|
{
|
|
|
|
# PreprocessSyscalls <preprocessedHeader> : <header> : <parsable> ;
|
|
|
|
#
|
|
|
|
local parsable = $(3) ;
|
|
|
|
local parsableDefine ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
if $(parsable) {
|
|
|
|
parsableDefine = GEN_SYSCALL_INFOS_PROCESSING ;
|
|
|
|
}
|
2004-08-29 00:26:52 +04:00
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
Depends $(<) : $(>) ;
|
|
|
|
|
|
|
|
local headers = [ on $(1) return $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ] ;
|
|
|
|
local sysHeaders =
|
2008-05-14 07:55:16 +04:00
|
|
|
$(TARGET_PRIVATE_SYSTEM_HEADERS)
|
2005-11-28 15:53:55 +03:00
|
|
|
[ 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)" ;
|
|
|
|
}
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
local syscallsHeader = [ FGristFiles syscalls.h ] ;
|
2008-05-14 07:55:16 +04:00
|
|
|
SEARCH on $(syscallsHeader) = [ FDirName $(HAIKU_TOP) headers private system ] ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
# 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 ] ;
|
2004-08-29 00:26:52 +04:00
|
|
|
local syscallsHeaderPP = [ FGristFiles syscalls.h.pp ] ;
|
2005-11-28 15:53:55 +03:00
|
|
|
MakeLocateArch $(syscallsHeaderPPParsable) $(syscallsHeaderPP) ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
PreprocessSyscalls $(syscallsHeaderPPParsable) : $(syscallsHeader) : true ;
|
|
|
|
PreprocessSyscalls $(syscallsHeaderPP) : $(syscallsHeader) ;
|
|
|
|
|
|
|
|
|
|
|
|
# build gensyscallinfos
|
|
|
|
|
|
|
|
BuildPlatformMain gensyscallinfos
|
|
|
|
: gensyscallinfos.cpp
|
2007-05-18 19:59:04 +04:00
|
|
|
: $(HOST_LIBSTDC++) $(HOST_LIBSUPC++)
|
2005-11-28 15:53:55 +03:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
# generate the syscall infos source file
|
|
|
|
|
|
|
|
local syscallInfos = [ FGristFiles gensyscalls_infos.cpp ] ;
|
2005-10-29 20:27:43 +04:00
|
|
|
MakeLocateArch $(syscallInfos) ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
rule GenSyscallInfos {
|
|
|
|
Depends $(1) : gensyscallinfos $(2) ;
|
|
|
|
GenSyscallInfos1 $(1) : gensyscallinfos $(2) ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions GenSyscallInfos1 {
|
|
|
|
$(2[1]) $(2[2]) $(1)
|
|
|
|
}
|
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
GenSyscallInfos $(syscallInfos) : $(syscallsHeaderPPParsable) ;
|
|
|
|
|
|
|
|
SubDirHdrs [ FDirName $(SUBDIR) arch $(TARGET_ARCH) ] ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
# build gensyscalls
|
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
BuildPlatformMain gensyscalls : gensyscalls.cpp $(syscallInfos) ;
|
2007-05-18 19:59:04 +04:00
|
|
|
LinkAgainst gensyscalls : $(HOST_LIBSTDC++) $(HOST_LIBSUPC++) ;
|
2005-11-28 15:53:55 +03:00
|
|
|
|
|
|
|
# Explicitly tell jam that gensyscalls.cpp includes the generated header.
|
|
|
|
Includes [ FGristFiles gensyscalls.cpp ] : $(syscallsHeaderPP) ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
# generate the output files
|
|
|
|
|
2005-11-28 15:53:55 +03:00
|
|
|
# place them where they are needed
|
2005-10-29 20:27:43 +04:00
|
|
|
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 ] ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2004-10-01 03:28:57 +04:00
|
|
|
rule GenSyscallsNumbers {
|
|
|
|
Depends $(1) : gensyscalls ;
|
|
|
|
GenSyscallsNumbers1 $(1) : gensyscalls ;
|
|
|
|
}
|
|
|
|
|
|
|
|
actions GenSyscallsNumbers1 {
|
|
|
|
$(2[1]) -n $(1)
|
|
|
|
}
|
|
|
|
|
2005-02-11 07:53:31 +03:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2004-08-29 00:26:52 +04:00
|
|
|
GenSyscallsFile <syscalls>syscalls.S.inc ;
|
|
|
|
GenSyscallsDispatcher <syscalls>syscall_dispatcher.h ;
|
2004-10-01 03:28:57 +04:00
|
|
|
GenSyscallsNumbers <syscalls>syscall_numbers.h ;
|
2005-02-11 07:53:31 +03:00
|
|
|
GenSyscallsTable <syscalls>syscall_table.h ;
|
|
|
|
GenSyscallsSTrace <syscalls>strace_syscalls.h ;
|