Mercurial > hg > CbC > CbC_xv6
comparison src/CMakeLists.txt @ 58:f1b965f53d3b
add tools userlists
author | tobaru |
---|---|
date | Fri, 05 Jul 2019 16:39:01 +0900 |
parents | a5ca5cc4661c |
children | 8f435de13b91 |
comparison
equal
deleted
inserted
replaced
57:450ee0f18709 | 58:f1b965f53d3b |
---|---|
1 cmake_minimum_required(VERSION 3.8) | 1 cmake_minimum_required(VERSION 3.8) |
2 project(xv6cbc C ASM) | 2 project(xv6cbc C ASM) |
3 | |
4 # https://github.com/llvm-mirror/libcxx/blob/master/cmake/Modules/HandleCompilerRT.cmake | |
5 function(find_compiler_rt_library dest) | |
6 set(dest "" PARENT_SCOPE) | |
7 set(CLANG_COMMAND ${CMAKE_C_COMPILER} | |
8 "--print-libgcc-file-name") | |
9 if (CMAKE_C_COMPILER_ID MATCHES Clang AND CMAKE_C_COMPILER_TARGET) | |
10 list(APPEND CLANG_COMMAND "--target=${CMAKE_C_COMPILER_TARGET}") | |
11 endif() | |
12 string(REPLACE " " ";" LIBC_C_FLAGS "${LIBC_C_FLAGS}") | |
13 list(APPEND CLANG_COMMAND ${LIBC_C_FLAGS}) | |
14 execute_process( | |
15 COMMAND ${CLANG_COMMAND} | |
16 RESULT_VARIABLE HAD_ERROR | |
17 OUTPUT_VARIABLE LIBRARY_FILE | |
18 ) | |
19 string(STRIP "${LIBRARY_FILE}" LIBRARY_FILE) | |
20 set(${dest} "${LIBRARY_FILE}" PARENT_SCOPE) | |
21 endfunction() | |
22 | |
23 | 3 |
24 | 4 |
25 set(USE_CUDA,0) | 5 set(USE_CUDA,0) |
26 # -DUSE_CUDA | 6 # -DUSE_CUDA |
27 # add_definitions("-Wall -g -O") | 7 # add_definitions("-Wall -g -O") |
28 | 8 |
29 if (APPLE) | |
30 set(CMAKE_C_COMPILER $ENV{CBC_LANG_COMPILER}) | |
31 add_definitions("-Wall -g -arch arm -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -Werror -I. -g -O0 | |
32 -Wno-macro-redefined -Wno-gnu-designator -Wno-sometimes-uninitialized -Wno-tautological-compare | |
33 -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include | |
34 -Wno-nullability-completeness -Wno-expansion-to-defined") | |
35 set(CMAKE_EXE_LINKER_FLAGS "-L. -arch armv7 -T kernel-cmake.ld -o kernel.elf ") | |
36 else (APPLE) | |
37 set(CMAKE_C_COMPILER /mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-gcc) | |
38 set(CMAKE_ASM_COMPILER /mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-gcc) | |
39 add_definitions("-B/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi- | |
40 -DCBCXV6=1 -fno-pic -static -fno-builtin -fno-strict-aliasing -Wall -I. -g -O0") | |
41 find_compiler_rt_library("LIBRARY_FILE") | |
42 #cmake -DCMAKE_LINKER=/path/to/linker -DCMAKE_CXX_LINK_EXECUTABLE="<CMAKE_LINKER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>" | |
43 set(CMAKE_C_LINK_EXECUTABLE "/mnt/dalmore-home/one/src/armgcc/cross/bin/arm-none-eabi-ld -L. -T kernel-cmake.ld -o kernel.elf -b binary -nostdlib <OBJECTS> ${LIBRARY_FILE}") | |
44 | |
45 endif (APPLE) | |
46 | |
47 # -DCMAKE_BUILD_TYPE=Debug | 9 # -DCMAKE_BUILD_TYPE=Debug |
48 set(CMAKE_C_FLAGS_DEBUG "-O0") | 10 set(CMAKE_C_FLAGS_DEBUG "-O0") |
11 add_definitions(${PMAKE_ARGS}) | |
12 set(CMAKE_C_COMPILER "${CBC_COM}") | |
13 | |
14 #add_custom_command(OUTPUT tools | |
15 # COMMAND "cd ${CMAKE_CURRENT_SOURCE_DIR}/tools && make run" | |
16 #) | |
17 # #WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tools | |
18 add_subdirectory(tools) | |
19 add_subdirectory(usr) | |
20 | |
49 | 21 |
50 if (${USE_CUDA}) | 22 if (${USE_CUDA}) |
51 include_directories("/usr/local/cuda/include") | 23 include_directories("/usr/local/cuda/include") |
52 set(NVCCFLAG "-std=c++11" "-g" "-O0" ) | 24 set(NVCCFLAG "-std=c++11" "-g" "-O0" ) |
53 if (UNIX AND NOT APPLE) # LINUX | 25 if (UNIX AND NOT APPLE) # LINUX |
109 lib/string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.cbc fs.c log.c main.c memide.c pipe.cbc proc.cbc spinlock.cbc | 81 lib/string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.cbc fs.c log.c main.c memide.c pipe.cbc proc.cbc spinlock.cbc |
110 start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c | 82 start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c |
111 lib/string.c entry.S | 83 lib/string.c entry.S |
112 ) | 84 ) |
113 | 85 |
114 |