From 21cca3fbeefbababf6f2918280b4fd5bd1b85b70 Mon Sep 17 00:00:00 2001 From: AceVest Date: Fri, 27 Jul 2018 15:45:47 +0800 Subject: [PATCH] ... --- rtos/CMakeLists.txt | 22 ++++++++++++++-------- rtos/components/CMakeLists.txt | 3 +-- rtos/components/debug/CMakeLists.txt | 6 ------ rtos/components/debug/Kconfig | 0 rtos/components/debug/Kconfig.projbuild | 0 rtos/components/debug/asm_debug.S | 7 ------- rtos/components/debug/component.mk | 0 rtos/components/debug/debug.c | 13 ------------- rtos/components/debug/debug.h | 14 -------------- rtos/rtos.c | 4 ++-- 10 files changed, 17 insertions(+), 52 deletions(-) delete mode 100644 rtos/components/debug/CMakeLists.txt delete mode 100644 rtos/components/debug/Kconfig delete mode 100644 rtos/components/debug/Kconfig.projbuild delete mode 100644 rtos/components/debug/asm_debug.S delete mode 100644 rtos/components/debug/component.mk delete mode 100644 rtos/components/debug/debug.c delete mode 100644 rtos/components/debug/debug.h diff --git a/rtos/CMakeLists.txt b/rtos/CMakeLists.txt index 1bdf7ae..6ea8a8b 100644 --- a/rtos/CMakeLists.txt +++ b/rtos/CMakeLists.txt @@ -1,21 +1,27 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.12) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -SET(RTOS_VERSION_MAJOR 0) +SET(CMAKE_VERBOSE_MAKEFILE on) +SET(RTOS_VERSION_MAJOR 0) SET(RTOS_VERSION_MINOR 1) - PROJECT(rtos) +ENABLE_LANGUAGE(ASM) + CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/rtos_config.h.in" "${PROJECT_BINARY_DIR}/rtos_config.h" ) -add_subdirectory(components) +ADD_SUBDIRECTORY(components) + +INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}" + "components/utils") + +LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH}) -include_directories("${PROJECT_BINARY_DIR}" - "components/debug") +ADD_EXECUTABLE(rtos rtos.c) -add_executable(rtos rtos.c) -target_link_libraries(rtos components) +# TARGET_LINK_LIBRARIES 参数里 debug optimized general 是关键词,不能用 +TARGET_LINK_LIBRARIES(rtos utils) diff --git a/rtos/components/CMakeLists.txt b/rtos/components/CMakeLists.txt index 2f6b0dd..674c9a1 100644 --- a/rtos/components/CMakeLists.txt +++ b/rtos/components/CMakeLists.txt @@ -1,2 +1 @@ -AUX_SOURCE_DIRECTORY(debug COMPONENTS_SRCS) -ADD_LIBRARY(components ${COMPONENTS_SRCS}) +ADD_SUBDIRECTORY(utils) diff --git a/rtos/components/debug/CMakeLists.txt b/rtos/components/debug/CMakeLists.txt deleted file mode 100644 index 1c9d980..0000000 --- a/rtos/components/debug/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -SET(CMAKE_ASM_FLAGS "-c") -ADD_LIBRARY(debug - debug.c - asm_debug.S -) - diff --git a/rtos/components/debug/Kconfig b/rtos/components/debug/Kconfig deleted file mode 100644 index e69de29..0000000 diff --git a/rtos/components/debug/Kconfig.projbuild b/rtos/components/debug/Kconfig.projbuild deleted file mode 100644 index e69de29..0000000 diff --git a/rtos/components/debug/asm_debug.S b/rtos/components/debug/asm_debug.S deleted file mode 100644 index db026e7..0000000 --- a/rtos/components/debug/asm_debug.S +++ /dev/null @@ -1,7 +0,0 @@ -.global _asm_debug - -_asm_debug: - nop - nop - nop - ret diff --git a/rtos/components/debug/component.mk b/rtos/components/debug/component.mk deleted file mode 100644 index e69de29..0000000 diff --git a/rtos/components/debug/debug.c b/rtos/components/debug/debug.c deleted file mode 100644 index 05062d9..0000000 --- a/rtos/components/debug/debug.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * ------------------------------------------------------------------------ - * File Name: debug.c - * Author: Zhao Yanbai - * 2018-07-07 14:02:11 Saturday CST - * Description: none - * ------------------------------------------------------------------------ - */ - -int debug() { - - return 0; -} diff --git a/rtos/components/debug/debug.h b/rtos/components/debug/debug.h deleted file mode 100644 index 2abfbdc..0000000 --- a/rtos/components/debug/debug.h +++ /dev/null @@ -1,14 +0,0 @@ -/* - * ------------------------------------------------------------------------ - * File Name: debug.h - * Author: Zhao Yanbai - * 2018-07-26 15:47:46 Thursday CST - * Description: none - * ------------------------------------------------------------------------ - */ - -#pragma once - -void debug(); - -void asm_debug(); diff --git a/rtos/rtos.c b/rtos/rtos.c index 189d108..7b361f8 100644 --- a/rtos/rtos.c +++ b/rtos/rtos.c @@ -8,11 +8,11 @@ */ #include #include "rtos_config.h" -#include "debug.h" +#include "utils.h" int main(int argc, char *argv[]){ printf("rtos: version %u.%u\n", RTOS_VERSION_MAJOR, RTOS_VERSION_MINOR); debug(); asm_debug(); - return 0; + return 0; } -- 2.44.0