[NFS]
[reactos.git] / reactos / boot / environ / CMakeLists.txt
index c0f8858..34b5b1a 100644 (file)
@@ -2,16 +2,25 @@
 include_directories(BEFORE include)
 include_directories(BEFORE include/efi)
 include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include)
-include_directories(${REACTOS_SOURCE_DIR}/lib/cmlib)
-include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs)
+include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cmlib)
+include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs)
+include_directories(${REACTOS_SOURCE_DIR}/drivers/filesystems)
 
 add_definitions(-D_NTHAL_ -D_BLDR_ -D_NTSYSTEM_)
 
 list(APPEND BOOTLIB_SOURCE
      app/bootmgr/bootmgr.h
      lib/bootlib.c
+     lib/misc/debug.c
      lib/misc/bcd.c
+     lib/misc/bcdopt.c
+     lib/misc/bootreg.c
      lib/misc/util.c
+     lib/misc/image.c
+     lib/misc/resource.c
+     lib/misc/font.c
+     lib/misc/rtlcompat.c
+     lib/firmware/fwutil.c
      lib/firmware/efi/firmware.c
      lib/mm/mm.c
      lib/mm/pagealloc.c
@@ -19,6 +28,8 @@ list(APPEND BOOTLIB_SOURCE
      lib/mm/blkalloc.c
      lib/mm/descriptor.c
      lib/platform/time.c
+     lib/io/blkcache.c
+     lib/io/etfs.c
      lib/io/io.c
      lib/io/device.c
      lib/io/file.c
@@ -34,7 +45,7 @@ list(APPEND BOOTLIB_SOURCE
 
 if(ARCH STREQUAL "i386")
     list(APPEND BOOTLIB_ASM_SOURCE
-         #lib/arch/i386/foo.asm
+         lib/arch/i386/transfer.s
          )
     list(APPEND BOOTLIB_SOURCE
          lib/arch/i386/arch.c
@@ -46,23 +57,27 @@ elseif(ARCH STREQUAL "amd64")
          )
     list(APPEND BOOTLIB_SOURCE
          #lib/arch/amd64/foo.c
+         lib/arch/stub/arch.c
+         lib/mm/stub/mm.c
          )
 else()
-#TBD
+    list(APPEND BOOTLIB_SOURCE
+         lib/arch/stub/arch.c
+         lib/mm/stub/mm.c
+         )
 endif()
 
 add_asm_files(bootlib_asm ${BOOTLIB_ASM_SOURCE})
 add_library(bootlib ${BOOTLIB_SOURCE} ${bootlib_asm})
 add_pch(bootlib app/bootmgr/bootmgr.h BOOTLIB_SOURCE)
-add_dependencies(bootlib bugcodes xdk)
+add_dependencies(bootlib bugcodes asm bootmsg xdk)
 
 list(APPEND BOOTMGR_BASE_SOURCE
      app/bootmgr/efiemu.c
      app/bootmgr/bootmgr.c
-     app/bootmgr/rtlcompat.c
      )
 
-add_executable(bootmgfw ${BOOTMGR_BASE_SOURCE})
+add_executable(bootmgfw ${BOOTMGR_BASE_SOURCE} app/bootmgr/bootmgr.rc)
 set_target_properties(bootmgfw PROPERTIES SUFFIX ".efi")
 
 if(MSVC)
@@ -91,5 +106,41 @@ endif()
 
 add_dependencies(bootmgfw asm bugcodes)
 
-add_cd_file(TARGET bootmgfw FILE ${_bootmgfw_output_file} DESTINATION efi/boot NO_CAB FOR bootcd regtest NAME_ON_CD bootia32.efi)
+list(APPEND ROSLOAD_BASE_SOURCE
+     app/rosload/rosload.c
+     )
+
+add_executable(rosload ${ROSLOAD_BASE_SOURCE})
+set_target_properties(rosload PROPERTIES SUFFIX ".efi")
+
+if(MSVC)
+    add_target_link_flags(rosload "/ignore:4078 /ignore:4254 /DRIVER")
+else()
+    add_target_link_flags(rosload "-Wl,--strip-all,--exclude-all-symbols,--dynamicbase,--pic-executable")
+endif()
+
+set_image_base(rosload 0x10000)
+
+if(MSVC)
+    set_subsystem(rosload BOOT_APPLICATION)
+else()
+    set_subsystem(rosload 16)
+endif()
+
+if(ARCH STREQUAL "i386")
+    set_entrypoint(rosload OslMain 4)
+else()
+    set_entrypoint(rosload OslMain)
+endif()
+
+target_link_libraries(rosload bootlib cportlib cmlib rtl libcntpr)
+
+if(STACK_PROTECTOR)
+    target_link_libraries(rosload gcc_ssp)
+elseif(RUNTIME_CHECKS)
+    target_link_libraries(rosload runtmchk)
+endif()
+
+add_dependencies(rosload asm bugcodes)
 
+add_cd_file(TARGET rosload DESTINATION reactos/system32/boot NO_CAB FOR all)