1 2include_directories(BEFORE include) 3include_directories(BEFORE include/efi) 4include_directories(${REACTOS_SOURCE_DIR}/ntoskrnl/include) 5include_directories(${REACTOS_SOURCE_DIR}/sdk/lib/cmlib) 6include_directories(${REACTOS_SOURCE_DIR}/sdk/include/reactos/libs) 7include_directories(${REACTOS_SOURCE_DIR}/drivers/filesystems) 8 9add_definitions(-D_NTHAL_ -D_BLDR_ -D_NTSYSTEM_) 10 11list(APPEND BOOTLIB_SOURCE 12 app/bootmgr/bootmgr.h 13 lib/bootlib.c 14 lib/misc/debug.c 15 lib/misc/bcd.c 16 lib/misc/bcdopt.c 17 lib/misc/bootreg.c 18 lib/misc/util.c 19 lib/misc/image.c 20 lib/misc/resource.c 21 lib/misc/font.c 22 lib/misc/rtlcompat.c 23 lib/firmware/fwutil.c 24 lib/firmware/efi/firmware.c 25 lib/mm/mm.c 26 lib/mm/pagealloc.c 27 lib/mm/heapalloc.c 28 lib/mm/blkalloc.c 29 lib/mm/descriptor.c 30 lib/platform/time.c 31 lib/io/blkcache.c 32 lib/io/etfs.c 33 lib/io/io.c 34 lib/io/device.c 35 lib/io/file.c 36 lib/io/fat.c 37 lib/io/display/display.c 38 lib/io/display/emscons.c 39 lib/io/display/guicons.c 40 lib/io/display/textcons.c 41 lib/io/display/efi/textcons.c 42 lib/io/display/efi/guicons.c 43 lib/io/display/efi/gop.c 44 lib/io/display/efi/uga.c) 45 46if(ARCH STREQUAL "i386") 47 list(APPEND BOOTLIB_ASM_SOURCE 48 lib/arch/i386/transfer.s 49 ) 50 list(APPEND BOOTLIB_SOURCE 51 lib/arch/i386/arch.c 52 lib/mm/i386/mmx86.c 53 ) 54elseif(ARCH STREQUAL "amd64") 55 list(APPEND BOOTLIB_ASM_SOURCE 56 #lib/arch/amd64/foo.asm 57 ) 58 list(APPEND BOOTLIB_SOURCE 59 #lib/arch/amd64/foo.c 60 lib/arch/stub/arch.c 61 lib/mm/stub/mm.c 62 ) 63else() 64 list(APPEND BOOTLIB_SOURCE 65 lib/arch/stub/arch.c 66 lib/mm/stub/mm.c 67 ) 68endif() 69 70add_asm_files(bootlib_asm ${BOOTLIB_ASM_SOURCE}) 71add_library(bootlib ${BOOTLIB_SOURCE} ${bootlib_asm}) 72add_pch(bootlib app/bootmgr/bootmgr.h BOOTLIB_SOURCE) 73add_dependencies(bootlib bugcodes asm bootmsg xdk) 74 75list(APPEND BOOTMGR_BASE_SOURCE 76 app/bootmgr/efiemu.c 77 app/bootmgr/bootmgr.c 78 ) 79 80add_executable(bootmgfw ${BOOTMGR_BASE_SOURCE} app/bootmgr/bootmgr.rc) 81set_target_properties(bootmgfw PROPERTIES SUFFIX ".efi") 82 83if(MSVC) 84 if (ARCH STREQUAL "arm") 85 add_target_link_flags(bootmgfw "/ignore:4078 /ignore:4254 /DRIVER") 86 else() 87 add_target_link_flags(bootmgfw "/ignore:4078 /ignore:4254 /DRIVER /FIXED") 88 endif() 89else() 90 add_target_link_flags(bootmgfw "-Wl,--strip-all,--exclude-all-symbols") 91endif() 92 93set_image_base(bootmgfw 0x10000) 94 95if(MSVC) 96 set_subsystem(bootmgfw EFI_APPLICATION) 97else() 98 set_subsystem(bootmgfw 10) 99endif() 100 101set_entrypoint(bootmgfw EfiEntry) 102 103target_link_libraries(bootmgfw bootlib cportlib cmlib rtl libcntpr) 104 105if(STACK_PROTECTOR) 106 target_link_libraries(bootmgfw gcc_ssp) 107elseif(RUNTIME_CHECKS) 108 target_link_libraries(bootmgfw runtmchk) 109endif() 110 111add_dependencies(bootmgfw asm bugcodes) 112 113list(APPEND ROSLOAD_BASE_SOURCE 114 app/rosload/rosload.c 115 app/rosload/roslogo.c 116 ) 117 118if(ARCH STREQUAL "i386") 119 list(APPEND ROSLOAD_ASM_SOURCE 120 app/rosload/i386/osxfera.s 121 ) 122endif() 123 124add_asm_files(rosload_asm ${ROSLOAD_ASM_SOURCE}) 125add_executable(rosload ${ROSLOAD_BASE_SOURCE} ${rosload_asm}) 126set_target_properties(rosload PROPERTIES SUFFIX ".efi") 127 128if(MSVC) 129 add_target_link_flags(rosload "/ignore:4078 /ignore:4254 /DRIVER") 130else() 131 add_target_link_flags(rosload "-Wl,--strip-all,--exclude-all-symbols,--dynamicbase,--pic-executable") 132endif() 133 134set_image_base(rosload 0x10000) 135 136if(MSVC) 137 set_subsystem(rosload BOOT_APPLICATION) 138else() 139 set_subsystem(rosload 16) 140endif() 141 142if(ARCH STREQUAL "i386") 143 set_entrypoint(rosload OslMain 4) 144else() 145 set_entrypoint(rosload OslMain) 146endif() 147 148target_link_libraries(rosload bootlib cportlib cmlib rtl libcntpr) 149 150if(STACK_PROTECTOR) 151 target_link_libraries(rosload gcc_ssp) 152elseif(RUNTIME_CHECKS) 153 target_link_libraries(rosload runtmchk) 154endif() 155 156add_dependencies(rosload asm bugcodes) 157 158add_cd_file(TARGET rosload DESTINATION reactos/system32/boot NO_CAB FOR all) 159