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