2004-08-22 04:06:00 +04:00
|
|
|
SubDir OBOS_TOP src tools gensyscalls ;
|
|
|
|
|
2004-08-29 00:26:52 +04:00
|
|
|
# build gensyscallinfos
|
|
|
|
|
|
|
|
BuildPlatformMain gensyscallinfos : gensyscallinfos.cpp ;
|
2004-09-10 22:29:52 +04:00
|
|
|
LinkSharedOSLibs gensyscallinfos : $(BUILD_LIBSTDC++) ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
# 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)) ;
|
2004-09-11 03:13:09 +04:00
|
|
|
LinkSharedOSLibs gensyscalls : $(BUILD_LIBSTDC++) ;
|
2004-09-02 00:17:57 +04:00
|
|
|
UsePrivateObjectHeaders gensyscalls.cpp : kernel ;
|
|
|
|
UseArchObjectHeaders gensyscalls.cpp : $(OBOS_ARCH) ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
# generate the output files
|
|
|
|
|
|
|
|
# place them where there are needed
|
2005-04-13 18:49:55 +04:00
|
|
|
MakeLocate <syscalls>syscalls.S.inc : [ FObjectsDir src system libroot os ] ;
|
|
|
|
MakeLocate <syscalls>syscall_dispatcher.h : [ FObjectsDir src system kernel ] ;
|
|
|
|
MakeLocate <syscalls>syscall_numbers.h : [ FObjectsDir src system kernel ] ;
|
|
|
|
MakeLocate <syscalls>syscall_table.h : [ FObjectsDir src system kernel ] ;
|
2005-03-19 04:10:29 +03:00
|
|
|
MakeLocate <syscalls>strace_syscalls.h : [ FObjectsDir src bin strace ] ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
2005-08-21 01:06:07 +04:00
|
|
|
Depends <dir>objects/$(OBOS_TARGET)/kernel/core : <dir>objects/$(OBOS_TARGET)/kernel ;
|
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 ;
|
2004-08-29 00:26:52 +04:00
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
{
|
2005-03-26 21:01:40 +03:00
|
|
|
$(C++) -xc++ -E "$(2)" $(CCFLAGS) $(CCDEFS) $(CCHDRS) -o "$(1)" ;
|
2004-08-29 00:26:52 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
Preprocess $(syscallsHeaderPP) : $(syscallsHeader) ;
|
|
|
|
|
|
|
|
|
|
|
|
# compile the syscall infos source file
|
|
|
|
|
|
|
|
Object $(syscallInfos:S=$(SUFOBJ)) : $(syscallInfos) ;
|