reactos/ntoskrnl/CMakeLists.txt
Jérôme Gardou 4ee1da42f1 [CMAKE]
- rewrite spec2def macro because
1. cmake gracefully handles def files as source files
2. cmake gracefully handles autogenerated files as source
3. it did not take into account the fact that all shared libraries haven't the .dll extension

svn path=/branches/cmake-bringup/; revision=49358
2010-10-30 16:08:19 +00:00

426 lines
8.8 KiB
CMake

set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> -i <SOURCE> <CMAKE_C_LINK_FLAGS> <DEFINES> -I${REACTOS_SOURCE_DIR}/include/psdk -I${REACTOS_BINARY_DIR}/include/psdk -I${REACTOS_SOURCE_DIR}/include/ -I${REACTOS_SOURCE_DIR}/include/reactos -I${REACTOS_BINARY_DIR}/include/reactos -I${REACTOS_SOURCE_DIR}/include/reactos/wine -I${REACTOS_SOURCE_DIR}/include/crt -I${REACTOS_SOURCE_DIR}/include/crt/mingw32 -I${REACTOS_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR}/include -O coff -o <OBJECT> ")
add_definitions(-D__NTOSKRNL__)
add_definitions(-D_NTOSKRNL_)
add_definitions(-D_NTSYSTEM_)
add_definitions(-D_IN_KERNEL_)
add_definitions(-DNTDDI_VERSION=0x05020400)
include_directories(${REACTOS_SOURCE_DIR}/lib/cmlib)
include_directories(include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/internal)
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/drivers)
list(APPEND SOURCE
cc/cacheman.c
cc/copy.c
cc/fs.c
cc/mdl.c
cc/pin.c
cc/view.c
config/cmalloc.c
config/cmapi.c
config/cmboot.c
config/cmcheck.c
config/cmconfig.c
config/cmcontrl.c
config/cmdata.c
config/cmdelay.c
config/cmhook.c
config/cmhvlist.c
config/cmindex.c
config/cminit.c
config/cmkcbncb.c
config/cmkeydel.c
config/cmlazy.c
config/cmmapvw.c
config/cmname.c
config/cmnotify.c
config/cmparse.c
config/cmquota.c
config/cmse.c
config/cmsecach.c
config/cmsysini.c
config/cmvalche.c
config/cmvalue.c
config/cmwraprs.c
config/ntapi.c
dbgk/dbgkobj.c
dbgk/dbgkutil.c
ex/atom.c
ex/callback.c
ex/dbgctrl.c
ex/efi.c
ex/event.c
ex/evtpair.c
ex/exintrin.c
ex/fastinterlck.c
ex/fmutex.c
ex/handle.c
ex/harderr.c
ex/hdlsterm.c
ex/init.c
ex/keyedevt.c
ex/locale.c
ex/lookas.c
ex/mutant.c
ex/profile.c
ex/pushlock.c
ex/resource.c
ex/rundown.c
ex/sem.c
ex/shutdown.c
ex/sysinfo.c
ex/time.c
ex/timer.c
ex/uuid.c
ex/win32k.c
ex/work.c
ex/xipdisp.c
ex/zone.c
fsrtl/dbcsname.c
fsrtl/fastio.c
fsrtl/faulttol.c
fsrtl/filelock.c
fsrtl/filter.c
fsrtl/filtrctx.c
fsrtl/fsfilter.c
fsrtl/fsrtlpc.c
fsrtl/largemcb.c
fsrtl/name.c
fsrtl/notify.c
fsrtl/oplock.c
fsrtl/pnp.c
fsrtl/stackovf.c
fsrtl/tunnel.c
fsrtl/unc.c
fstub/disksup.c
fstub/fstubex.c
fstub/halstub.c
inbv/inbv.c
inbv/inbvport.c
io/iomgr/adapter.c
io/iomgr/arcname.c
io/iomgr/bootlog.c
io/iomgr/controller.c
io/iomgr/device.c
io/iomgr/deviface.c
io/iomgr/driver.c
io/iomgr/error.c
io/iomgr/file.c
io/iomgr/iocomp.c
io/iomgr/ioevent.c
io/iomgr/iofunc.c
io/iomgr/iomdl.c
io/iomgr/iomgr.c
io/iomgr/iorsrce.c
io/iomgr/iotimer.c
io/iomgr/iowork.c
io/iomgr/irp.c
io/iomgr/irq.c
io/iomgr/ramdisk.c
io/iomgr/rawfs.c
io/iomgr/remlock.c
io/iomgr/symlink.c
io/iomgr/util.c
io/iomgr/volume.c
io/pnpmgr/plugplay.c
io/pnpmgr/pnpdma.c
io/pnpmgr/pnpinit.c
io/pnpmgr/pnpmgr.c
io/pnpmgr/pnpnotify.c
io/pnpmgr/pnpreport.c
io/pnpmgr/pnpres.c
io/pnpmgr/pnproot.c
io/pnpmgr/pnputil.c
ke/apc.c
ke/balmgr.c
ke/bug.c
ke/clock.c
ke/config.c
ke/devqueue.c
ke/dpc.c
ke/eventobj.c
ke/except.c
ke/freeze.c
ke/gate.c
ke/gmutex.c
ke/ipi.c
ke/krnlinit.c
ke/mutex.c
ke/procobj.c
ke/profobj.c
ke/queue.c
ke/semphobj.c
ke/spinlock.c
ke/thrdobj.c
ke/thrdschd.c
ke/time.c
ke/timerobj.c
ke/wait.c
lpc/close.c
lpc/complete.c
lpc/connect.c
lpc/create.c
lpc/listen.c
lpc/port.c
lpc/reply.c
lpc/send.c
mm/ARM3/contmem.c
mm/ARM3/drvmgmt.c
mm/ARM3/dynamic.c
mm/ARM3/expool.c
mm/ARM3/hypermap.c
mm/ARM3/iosup.c
mm/ARM3/largepag.c
mm/ARM3/mdlsup.c
mm/ARM3/mmdbg.c
mm/ARM3/mminit.c
mm/ARM3/mmsup.c
mm/ARM3/ncache.c
mm/ARM3/pagfault.c
mm/ARM3/pfnlist.c
mm/ARM3/pool.c
mm/ARM3/procsup.c
mm/ARM3/section.c
mm/ARM3/sysldr.c
mm/ARM3/syspte.c
mm/ARM3/vadnode.c
mm/ARM3/virtual.c
mm/ARM3/zeropage.c
mm/anonmem.c
mm/balance.c
mm/freelist.c
mm/marea.c
mm/mmfault.c
mm/mminit.c
mm/pagefile.c
mm/pageop.c
mm/region.c
mm/rmap.c
mm/section.c
ob/obdir.c
ob/obhandle.c
ob/obinit.c
ob/oblife.c
ob/oblink.c
ob/obname.c
ob/obref.c
ob/obsdcach.c
ob/obsecure.c
ob/obwait.c
po/events.c
po/poshtdwn.c
po/povolume.c
po/power.c
ps/debug.c
ps/job.c
ps/kill.c
ps/process.c
ps/psmgr.c
ps/psnotify.c
ps/query.c
ps/quota.c
ps/security.c
ps/state.c
ps/thread.c
ps/win32.c
rtl/libsupp.c
rtl/misc.c
se/access.c
se/acl.c
se/audit.c
se/lsa.c
se/priv.c
se/sd.c
se/semgr.c
se/sid.c
se/token.c
vf/driver.c
wmi/wmi.c
ntoskrnl.rc
${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
${CMAKE_CURRENT_SOURCE_DIR}/ntoskrnl_${ARCH}.def)
if(ARCH MATCHES i386)
list(APPEND SOURCE
config/i386/cmhardwr.c
ex/i386/interlck_asm.S
ex/i386/fastinterlck_asm.S
ex/i386/ioport.S
ke/freeldr.c
ke/i386/abios.c
ke/i386/cpu.c
ke/i386/context.c
ke/i386/ctxswitch.S
ke/i386/exp.c
ke/i386/irqobj.c
ke/i386/kiinit.c
ke/i386/ldt.c
ke/i386/mtrr.c
ke/i386/patpge.c
ke/i386/thrdini.c
ke/i386/trap.s
ke/i386/traphdlr.c
ke/i386/usercall_asm.S
ke/i386/usercall.c
ke/i386/v86vdm.c
mm/i386/page.c
mm/ARM3/i386/init.c
ps/i386/psctx.c
ps/i386/psldt.c
rtl/i386/stack.S
vdm/vdmmain.c
vdm/vdmexec.c)
elseif(ARCH MATCHES amd64)
list(APPEND SOURCE
config/i386/cmhardwr.c
ex/amd64/fastinterlck.c
ke/amd64/boot.S
ke/amd64/context.c
ke/amd64/cpu.c
ke/amd64/ctxswitch.S
ke/amd64/except.c
ke/amd64/interrupt.c
ke/amd64/irql.c
ke/amd64/kiinit.c
ke/amd64/spinlock.c
ke/amd64/stubs.c
ke/amd64/thrdini.c
ke/amd64/trap.S
mm/amd64/init.c
mm/amd64/page.c
ps/amd64/psctx.c)
elseif(ARCH MATCHES arm)
list(APPEND SOURCE
config/arm/cmhardwr.c
ke/arm/boot.s
ke/arm/cpu.c
ke/arm/ctxswtch.s
ke/arm/exp.c
ke/arm/kiinit.c
ke/arm/stubs_asm.s
ke/arm/thrdini.c
ke/arm/trap.s
ke/arm/trapc.c
ke/arm/usercall.c
mm/arm/page.c
mm/ARM3/arm/init.c
ps/arm/psctx.c
rtl/arm/rtlexcpt.c)
elseif(ARCH MATCHES powerpc)
list(APPEND SOURCE
config/powerpc/cmhardwr.c
ke/powerpc/main_asm.S
ke/powerpc/cpu.c
ke/powerpc/exp.c
ke/powerpc/kiinit.c
ke/powerpc/ppc_irq.c
ke/powerpc/stubs.c
ke/powerpc/systimer.c
ke/powerpc/thrdini.c
ke/powerpc/ctxswitch.c
ke/powerpc/ctxhelp.S
mm/powerpc/pfault.c
mm/powerpc/page.c)
endif(ARCH MATCHES i386)
if(NOT _WINKD_)
if(ARCH MATCHES i386)
list(APPEND SOURCE
kd/i386/kdmemsup.c
kd/wrappers/gdbstub.c)
if(KDBG)
list(APPEND SOURCE
kdbg/i386/i386-dis.c
kdbg/i386/kdb_help.S
kdbg/i386/longjmp.S
kdbg/i386/setjmp.S)
endif(KDBG)
elseif(ARCH MATCHES amd64)
list(APPEND SOURCE
kd/amd64/kd.c
kd/amd64/kdmemsup.c)
if(KDBG)
list(APPEND SOURCE
kdbg/amd64/i386-dis.c
kdbg/amd64/kdb_help.S
kdbg/amd64/kdb.c)
endif(KDBG)
elseif(ARCH MATCHES powerpc)
list(APPEND SOURCE kd/wrappers/gdbstub_powerpc.c)
endif(ARCH MATCHES i386)
if(KDBG)
list(APPEND SOURCE
kdbg/kdb.c
kdbg/kdb_cli.c
kdbg/kdb_expr.c
kdbg/kdb_keyboard.c
kdbg/kdb_serial.c)
endif(KDBG)
if(DBG OR KDBG)
list(APPEND SOURCE kdbg/kdb_symbols.c)
endif(DBG OR KDBG)
list(APPEND SOURCE
kd/wrappers/bochs.c
kd/wrappers/kdbg.c
kd/kdinit.c
kd/kdio.c
kd/kdmain.c)
else() # _WINKD_
list(APPEND SOURCE
kd64/kdapi.c
kd64/kdbreak.c
kd64/kddata.c
kd64/kdinit.c
kd64/kdlock.c
kd64/kdprint.c
kd64/kdtrap.c)
if(ARCH MATCHES i386)
list(APPEND SOURCE kd64/i386/kdx86.c)
elseif(ARCH MATCHES amd64)
list(APPEND SOURCE kd64/amd64/kdx64.c)
elseif(ARCH MATCHES arm)
list(APPEND SOURCE kd64/arm/kdarm.c)
endif(ARCH MATCHES i386)
endif(NOT _WINKD_)
add_executable(ntoskrnl ${SOURCE} ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl_ntoskrnl.h.gch)
set_target_properties(ntoskrnl PROPERTIES LINK_FLAGS "-Wl,-entry,_KiSystemStartup@4 -Wl,--image-base,0x80800000 -Wl,--subsystem,native")
target_link_libraries(ntoskrnl
cportlib
csq
-lhal
pseh
cmlib
rtl
rossym
libcntpr
-lkdcom
-lbootvid
wdmguid
ioevent)
add_pch(ntoskrnl ${CMAKE_CURRENT_SOURCE_DIR}/include/ntoskrnl.h ${SOURCE})
set_source_files_properties(${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S PROPERTIES GENERATED TRUE)
add_dependencies(ntoskrnl psdk bugcodes kernel_zw kernel_napi)
add_minicd_target(ntoskrnl reactos ntoskrnl.exe)
add_livecd_target(ntoskrnl reactos/system32)