os/kernelhwsrv/kernel/eka/kernel/ekern.cmake
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
child 1 260cb5ec6c19
permissions -rw-r--r--
First public contribution.
sl@0
     1
# Copyright (c) 2009 Stéphane Lenclud.
sl@0
     2
# All rights reserved.
sl@0
     3
# This component and the accompanying materials are made available
sl@0
     4
# under the terms of the License "Eclipse Public License v1.0"
sl@0
     5
# which accompanies this distribution, and is available
sl@0
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
#
sl@0
     8
# Initial Contributors:
sl@0
     9
# Stéphane Lenclud.
sl@0
    10
#
sl@0
    11
sl@0
    12
push_target(ekern)
sl@0
    13
sl@0
    14
#----------------------------------------------------------------
sl@0
    15
#Add current file to our source tree
sl@0
    16
add_cmake_source()
sl@0
    17
#Make sure all the output from all projects will go in one place
sl@0
    18
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin)
sl@0
    19
#Visual Studio IDE folders
sl@0
    20
source_group(Sources REGULAR_EXPRESSION ".+\\.cpp$")
sl@0
    21
source_group(Includes REGULAR_EXPRESSION ".+\\.h$") 	
sl@0
    22
source_group(Def REGULAR_EXPRESSION ".+\\.def$") 	
sl@0
    23
#----------------------------------------------------------------
sl@0
    24
sl@0
    25
sl@0
    26
include_directories (../euser ../euser/unicode ../include 
sl@0
    27
../include/nkern ../include/nkern/win32 ../include/kernel ../include/kernel/win32 ../include/memmodel/emul/win32 ../include/memmodel/emul)
sl@0
    28
sl@0
    29
#Define source for ekern
sl@0
    30
set (sourcepath ../nkern/)
sl@0
    31
add_source(
sl@0
    32
nkern.cpp nkerns.cpp sched.cpp dfcs.cpp nk_timer.cpp
sl@0
    33
nk_old.cpp
sl@0
    34
)
sl@0
    35
sl@0
    36
set (sourcepath ../common/win32/)
sl@0
    37
add_source(
sl@0
    38
atomics.cpp
sl@0
    39
)
sl@0
    40
sl@0
    41
set (sourcepath ../nkern/win32/)
sl@0
    42
add_source(
sl@0
    43
vectors.cpp ncsched.cpp nctimer.cpp ncutilf.cpp ncutils.cpp
sl@0
    44
ncthrd.cpp ncglob.cpp
sl@0
    45
)
sl@0
    46
sl@0
    47
set (sourcepath ../common/win32/)
sl@0
    48
add_source(
sl@0
    49
seh.cpp
sl@0
    50
)
sl@0
    51
sl@0
    52
#UID data seg. TODO: generate that?
sl@0
    53
set (sourcepath ./win32/)
sl@0
    54
add_source(
sl@0
    55
ekern_uid.cpp
sl@0
    56
)
sl@0
    57
sl@0
    58
set (sourcepath ../kernel/win32/)
sl@0
    59
add_source(
sl@0
    60
cboot.cpp
sl@0
    61
cglobals.cpp cexec.cpp cinit.cpp
sl@0
    62
ckernel.cpp csched.cpp
sl@0
    63
cutils.cpp cache.cpp
sl@0
    64
k_entry.cpp #originally from kc_exe.mmp
sl@0
    65
#TODO: add our own entry point?
sl@0
    66
)
sl@0
    67
sl@0
    68
sl@0
    69
set (sourcepath ../kernel/)
sl@0
    70
add_source(
sl@0
    71
sglobals.cpp device.cpp eventq.cpp
sl@0
    72
sexec.cpp sinit.cpp skernel.cpp
sl@0
    73
scodeseg.cpp sipc.cpp notifier.cpp 
sl@0
    74
object.cpp power.cpp server.cpp
sl@0
    75
stimer.cpp sutils.cpp random.cpp
sl@0
    76
sprocess.cpp sthread.cpp 
sl@0
    77
smqueue.cpp
sl@0
    78
sproperty.cpp
sl@0
    79
ssharedio.cpp
sl@0
    80
ssecure.cpp
sl@0
    81
emi.cpp
sl@0
    82
objectix.cpp
sl@0
    83
sbtrace.cpp
sl@0
    84
stest.cpp
sl@0
    85
sshbuf.cpp smap.cpp
sl@0
    86
)
sl@0
    87
				
sl@0
    88
set (sourcepath ../klib/)
sl@0
    89
add_source(
sl@0
    90
dbase.cpp kdes8.cpp
sl@0
    91
kheap.cpp bma.cpp
sl@0
    92
)
sl@0
    93
sl@0
    94
#
sl@0
    95
set (sourcepath ../common/)
sl@0
    96
add_source(
sl@0
    97
alloc.cpp array.cpp des8.cpp heap.cpp mem.cpp
sl@0
    98
secure.cpp
sl@0
    99
)
sl@0
   100
sl@0
   101
set (sourcepath ../memmodel/emul/)
sl@0
   102
add_source(
sl@0
   103
pglobals.cpp
sl@0
   104
nvram.cpp
sl@0
   105
)
sl@0
   106
sl@0
   107
#
sl@0
   108
set (sourcepath ../memmodel/emul/win32/)
sl@0
   109
add_source(
sl@0
   110
zrom.cpp
sl@0
   111
mchunk.cpp mglobals.cpp minit.cpp mkernel.cpp
sl@0
   112
mcodeseg.cpp mprocess.cpp mutils.cpp mshbuf.cpp
sl@0
   113
)
sl@0
   114
sl@0
   115
#def export
sl@0
   116
set (sourcepath ../blike/)
sl@0
   117
add_source(
sl@0
   118
ekern.def
sl@0
   119
)
sl@0
   120
sl@0
   121
#------------------------------------------------------------------------------------
sl@0
   122
# Define target
sl@0
   123
#------------------------------------------------------------------------------------
sl@0
   124
#It looks like exes on wins are still DLL but with a .exe extension 
sl@0
   125
get_source(source) 
sl@0
   126
add_library(ekern SHARED ${source})
sl@0
   127
set_target_properties(ekern PROPERTIES SUFFIX ".exe")
sl@0
   128
#add_executable(ekern ${source})
sl@0
   129
target_link_libraries(ekern kernel32 emulator scppnwdl_kern)
sl@0
   130
#------------------------------------------------------------------------------------
sl@0
   131
sl@0
   132
#add_dependencies(ekern genexec)
sl@0
   133
#set_target_properties(ekern PROPERTIES LINK_FLAGS "/ENTRY:KernelMain /NODEFAULTLIB")
sl@0
   134
#target_link_libraries(ekern kernel32 msvcrt)
sl@0
   135
#set_target_properties(ekern PROPERTIES COMPILE_FLAGS "/Zl")
sl@0
   136
#install(TARGETS ekern DESTINATION ./symbian/bin)
sl@0
   137
sl@0
   138
add_define(__EXPORT_MEMCPY__)				
sl@0
   139
add_define(__IN_KERNEL__)
sl@0
   140
add_define(__KERNEL_MODE__)
sl@0
   141
add_define(__MEMMODEL_EMUL_SINGLE_HOST_PROCESS__)
sl@0
   142
#__CPU_X86 is declared by __WINS__ 
sl@0
   143
#add_define(__CPU_X86)
sl@0
   144
#add_define(__DLL__)
sl@0
   145
sl@0
   146
sl@0
   147
##
sl@0
   148
##Copy ekern.dll to be next to epoc.exe
sl@0
   149
##
sl@0
   150
sl@0
   151
#get_target_property(LIB_NAME ekern LOCATION)
sl@0
   152
#get_target_property(DEST_NAME epoc LOCATION)
sl@0
   153
#set(target_suffix .dll)
sl@0
   154
#Extract path from full filename
sl@0
   155
#string(REGEX REPLACE "(^.+)/epoc.exe" "\\1" DEST_NAME ${DEST_NAME})
sl@0
   156
#set(DEST_NAME ${DEST_NAME}/ekern${target_suffix})
sl@0
   157
sl@0
   158
#message(${DEST_NAME})
sl@0
   159
sl@0
   160
#add_custom_command (
sl@0
   161
# 	TARGET ekern
sl@0
   162
#   	POST_BUILD
sl@0
   163
#   	COMMAND ${CMAKE_COMMAND} -E copy ${LIB_NAME} ${DEST_NAME}
sl@0
   164
# 	)
sl@0
   165
	
sl@0
   166
######################
sl@0
   167
sl@0
   168
sl@0
   169
pop_target(ekern)