haiku/src/tools/gensyscalls/Jamfile

143 lines
3.4 KiB
Plaintext
Raw Normal View History

SubDir OBOS_TOP src tools gensyscalls ;
# build gensyscallinfos
BuildPlatformMain gensyscallinfos : gensyscallinfos.cpp ;
LinkSharedOSLibs gensyscallinfos : $(BUILD_LIBSTDC++) ;
# generate the syscall infos source file
SetupObjectsDir ;
local syscallsHeader = [ FGristFiles syscalls.h ] ;
SEARCH on $(syscallsHeader) = [ FDirName $(OBOS_TOP) headers private kernel ] ;
local syscallsHeaderPP = [ FGristFiles syscalls.h.pp ] ;
LOCATE on $(syscallsHeaderPP) = $(LOCATE_SOURCE) ;
local syscallInfos = [ FGristFiles gensyscalls_infos.c ] ;
LOCATE on $(syscallInfos) = $(LOCATE_SOURCE) ;
rule GenSyscallInfos {
Depends $(1) : gensyscallinfos $(2) ;
GenSyscallInfos1 $(1) : gensyscallinfos $(2) ;
}
actions GenSyscallInfos1 {
$(2[1]) $(2[2]) $(1)
}
GenSyscallInfos $(syscallInfos) : $(syscallsHeaderPP) ;
# build gensyscalls
BuildPlatformMain gensyscalls : gensyscalls.cpp $(syscallInfos:S=$(SUFOBJ)) ;
LinkSharedOSLibs gensyscalls : $(BUILD_LIBSTDC++) ;
UsePrivateObjectHeaders gensyscalls.cpp : kernel ;
UseArchObjectHeaders gensyscalls.cpp : $(OBOS_ARCH) ;
# generate the output files
# place them where there are needed
MakeLocate <syscalls>syscalls.S.inc : [ FObjectsDir src kernel libroot os ] ;
MakeLocate <syscalls>syscall_dispatcher.h : [ FObjectsDir src kernel core ] ;
MakeLocate <syscalls>syscall_numbers.h : [ FObjectsDir src kernel core ] ;
MakeLocate <syscalls>syscall_table.h : [ FObjectsDir src kernel core ] ;
MakeLocate <syscalls>strace_syscalls.h : [ FObjectsDir src apps bin strace ] ;
Depends <dir>objects/x86.R1/kernel/core : <dir>objects/x86.R1/kernel ;
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 ;
# preprocess the syscalls header
SetupIncludes ;
UsePrivateHeaders kernel ;
UseArchHeaders $(OBOS_ARCH) ;
rule Preprocess
{
Depends $(<) : $(>) ;
HDRS on $(<) = $(SEARCH_SOURCE) $(SUBDIRHDRS) $(HDRS) ;
HDRRULE on $(>) = HdrRule ;
HDRSCAN on $(>) = $(HDRPATTERN) ;
HDRSEARCH on $(>) =
$(SEARCH_SOURCE:E) $(SUBDIRHDRS) $(HDRS) $(STDHDRS) ;
HDRGRIST on $(>) = $(HDRGRIST) ;
DEFINES on $(<) += $(DEFINES) ;
CCFLAGS on $(<) += $(CCFLAGS) $(SUBDIRCCFLAGS) $(OPTIM)
[ FDefines GEN_SYSCALL_INFOS_PROCESSING ] ;
CCHDRS on $(<) = [ on $(<) FIncludes $(HDRS) ] ;
CCDEFS on $(<) = [ on $(<) FDefines $(DEFINES) ] ;
}
actions Preprocess
{
$(CC) -E "$(2)" $(CCFLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)" ;
}
Preprocess $(syscallsHeaderPP) : $(syscallsHeader) ;
# compile the syscall infos source file
Object $(syscallInfos:S=$(SUFOBJ)) : $(syscallInfos) ;