From 6528cf1fdc22cfcfc92b37064bd849354983af12 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Fri, 23 May 2003 22:43:03 +0000 Subject: [PATCH] Add experimental jamfiles (still buggy). svn path=/trunk/; revision=4745 --- reactos/Jamfile | 5 ++ reactos/Jamrules | 54 ++++++++++++++++++++++ reactos/lib/Jamfile | 5 ++ reactos/lib/advapi32/Jamfile | 34 ++++++++++++++ reactos/lib/kernel32/Jamfile | 66 +++++++++++++++++++++++++++ reactos/lib/ntdll/Jamfile | 88 ++++++++++++++++++++++++++++++++++++ 6 files changed, 252 insertions(+) create mode 100644 reactos/Jamfile create mode 100644 reactos/Jamrules create mode 100644 reactos/lib/Jamfile create mode 100644 reactos/lib/advapi32/Jamfile create mode 100644 reactos/lib/kernel32/Jamfile create mode 100644 reactos/lib/ntdll/Jamfile diff --git a/reactos/Jamfile b/reactos/Jamfile new file mode 100644 index 00000000000..373f9c671f3 --- /dev/null +++ b/reactos/Jamfile @@ -0,0 +1,5 @@ +# Main jamfile for ReactOS + +SubDir ROS_TOP ; + +SubInclude ROS_TOP Lib ; diff --git a/reactos/Jamrules b/reactos/Jamrules new file mode 100644 index 00000000000..c5128083ef1 --- /dev/null +++ b/reactos/Jamrules @@ -0,0 +1,54 @@ +# customization for ReactOS goes here + +# The SharedLibrary and SharedLibraryFromObjects rules were +# borrowed from here: +# http://www.differentpla.net/~roger/devel/jam/tutorial/shared_lib/index.html + +SUFSHR = .dll ; +RM = rm ; # rm comes with MinGW, and the default del doesn't work in some cases + +rule SharedLibrary +{ + SharedLibraryFromObjects $(<) : $(>:S=$(SUFOBJ)) ; + Objects $(>) ; +} + +rule SharedLibraryFromObjects +{ + local _s _t ; + + # Add grist to file names + # Add suffix to dll + + _s = [ FGristFiles $(>) ] ; + _t = [ FAppendSuffix $(<) : $(SUFSHR) ] ; + + if $(_t) != $(<) + { + DEPENDS $(<) : $(_t) ; + NOTFILE $(<) ; + } + + # make compiled sources a dependency of target + + DEPENDS exe : $(_t) ; + DEPENDS $(_t) : $(_s) ; + MakeLocate $(_t) : $(LOCATE_TARGET) ; + + Clean clean : $(_t) ; + + Link $(_t) : $(_s) ; +} + +# nasm needs to know the output file first, or it doesn't +# recognize -I :( +actions As +{ + $(AS) -o $(<) $(ASFLAGS) -I$(HDRS) $(>) +} + +AS = nasm ; + +# why isn't DEFINES working? :( +#DEFINES += _M_IX86 ; +CCFLAGS += -D_M_IX86 ; diff --git a/reactos/lib/Jamfile b/reactos/lib/Jamfile new file mode 100644 index 00000000000..652cc6809ae --- /dev/null +++ b/reactos/lib/Jamfile @@ -0,0 +1,5 @@ +SubDir ROS_TOP Lib ; + +SubInclude ROS_TOP Lib Ntdll ; +SubInclude ROS_TOP Lib Advapi32 ; +SubInclude ROS_TOP Lib Kernel32 ; diff --git a/reactos/lib/advapi32/Jamfile b/reactos/lib/advapi32/Jamfile new file mode 100644 index 00000000000..5d4ab4d351d --- /dev/null +++ b/reactos/lib/advapi32/Jamfile @@ -0,0 +1,34 @@ +SubDir ROS_TOP Lib Advapi32 ; + +# This stuff should actually be moved to Jamrules +# in order to more easily support other compilers +CCFLAGS += -Wall -fno-builtin ; + +# NOTE - I'm no Jam expert, yet. This stuff should be +# abstracted into the Jamrules file. +LINKFLAGS += -nostartfiles -nostdlib ; +LINKFLAGS += -Wl,--image-base,0x77DB0000 ; + +MISC_SRCS = dllmain shutdown sysfunc ; + +REG_SRCS = reg ; + +SEC_SRCS = ac lsa misc sec sid ; + +SERVICE_SRCS = scm sctrl undoc ; + +TOKEN_SRCS = privilege token ; + +ADVAPI32_SRCS = + misc/$(MISC_SRCS).c + reg/$(REG_SRCS).c + sec/$(SEC_SRCS).c + service/$(SERVICE_SRCS).c + token/$(TOKEN_SRCS).c + ; + +SharedLibrary advapi32 : $(ADVAPI32_SRCS) ; +LINKLIBS = + $(ROS_TOP)/dk/w32/lib/ntdll.a + $(ROS_TOP)/dk/w32/lib/kernel32.a + ; diff --git a/reactos/lib/kernel32/Jamfile b/reactos/lib/kernel32/Jamfile new file mode 100644 index 00000000000..76bb738a5c9 --- /dev/null +++ b/reactos/lib/kernel32/Jamfile @@ -0,0 +1,66 @@ +SubDir ROS_TOP lib kernel32 ; + +# This stuff should actually be moved to Jamrules +# in order to more easily support other compilers +CCFLAGS += -Wall -fno-builtin ; + +# NOTE - I'm no Jam expert, yet. This stuff should be +# abstracted into the Jamrules file. +LINKFLAGS = -nostartfiles -nostdlib -shared ; +LINKFLAGS += -Wl,--image-base,0x77F00000 -lgcc ; + + +SYNCH_SRCS = + critical event intrlck mutex + sem timer wait + ; + +MISC_SRCS = + error atom handle env + dllmain comm errormsg + console time toolhelp + stubs ldr res + sysinfo profile + mbchars muldiv getname + perfcnt + ; + +FILE_SRCS = + file curdir lfile dir + iocompl volume deviceio dosdev + create find copy pipe + move lock rw delete + npipe tape mailslot backup + cnotify + ; + +MEM_SRCS = + global heap isbad local + procmem section virtual + ; + +THREAD_SRCS = fiber thread tls ; + +PROCESS_SRCS = proc cmdline create session ; + +STRING_SRCS = lstring ; + +EXCEPT_SRCS = except ; + +KERNEL32_SRCS = + misc/$(MISC_SRCS).c + file/$(FILE_SRCS).c + thread/$(THREAD_SRCS).c + process/$(PROCESS_SRCS).c + string/$(STRING_SRCS).c + mem/$(MEM_SRCS).c + synch/$(SYNCH_SRCS).c + except/$(EXCEPT_SRCS).c + ; + + +SharedLibrary kernel32 : $(KERNEL32_SRCS) ; +LINKLIBS = + $(ROS_TOP)/dk/w32/lib/ntdll.a + $(ROS_TOP)/dk/w32/lib/rosrtl.a + ; diff --git a/reactos/lib/ntdll/Jamfile b/reactos/lib/ntdll/Jamfile new file mode 100644 index 00000000000..445a7bb633d --- /dev/null +++ b/reactos/lib/ntdll/Jamfile @@ -0,0 +1,88 @@ +SubDir ROS_TOP Lib Ntdll ; + +HDRS += $(ROS_TOP)/Include ; +#Echo HDRS is $(HDRS) ; + +#Echo AS is $(AS) ; + +# for some reason DEFINES isn't coming in :( +#DEFINES += __NTDLL__ ; +CCFLAGS += -D__NTDLL__ ; # less portable :( + +# This stuff should actually be moved to Jamrules +# in order to more easily support other compilers +#CCFLAGS += -Wall -Werror -fno-builtin ; +CCFLAGS += -Wall -fno-builtin ; + +# NOTE - I'm no Jam expert, yet. This stuff should be +# abstracted into the Jamrules file. +LINKFLAGS += -Wl,--image-base,0x77f60000 ; +LINKFLAGS += -Wl,--file-alignment,0x1000 + -Wl,--section-alignment,0x1000 + -nostartfiles + ; + +# This needs to be abstracted to Jamrules, too +LINKFLAGS += -Wl,--entry,_LdrInitializeThunk@16 ; + +# we need to override action As here, because we're +# compiling except.s with gcc instead of as... +actions As +{ + $(CC) -c -x assembler-with-cpp $(ASFLAGS) -c $(>) -o $(<) +} + + +CSR_SRCS = lpc capture probe thread ; + +DBG_SRCS = brkpoint debug print ; #winedbg + +RTL_I386_SRCS = exception.c except.s ; + +RTL_SRCS = critical error heap largeint + math mem nls process sd + thread unicode env path ppb + bitmap time acl sid image + access apc callback luid misc + registry exception intrlck resource + handle atom message timezone + propvar security dos8dot3 compress + ; + +STDIO_SRCS = sprintf swprintf ; + +STDLIB_SRCS = abs atoi atoi64 atol + itoa itow labs splitp + strtol strtoul wcstol + wcstoul wtoi wtoi64 wtol + mbstowcs wcstombs qsort + ; + +STRING_SRCS = ctype memccpy memchr + memcmp memcpy memicmp + memmove memset strcat + strchr strcmp strcspn + strcpy stricmp strlen + strlwr strncat strncmp + strncpy strnicmp strnlen + strpbrk strrchr strspn + strstr strupr wstring + ; + +NTDLL_SRCS = + napi.c + ldr/startup.c + rtl/i386/$(RTL_I386_SRCS) + dbg/$(DBG_SRCS).c + rtl/$(RTL_SRCS).c + stdio/$(STDIO_SRCS).c + stdlib/$(STDLIB_SRCS).c + string/$(STRING_SRCS).c + stubs/stubs.c + ldr/res.c + ldr/utils.c + csr/$(CSR_SRCS).c + ; + + +SharedLibrary ntdll : $(NTDLL_SRCS) ;