-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)
+++ /dev/null
-/*
- * ------------------------------------------------------------------------
- * File Name: debug.c
- * Author: Zhao Yanbai
- * 2018-07-07 14:02:11 Saturday CST
- * Description: none
- * ------------------------------------------------------------------------
- */
-
-int debug() {
-
- return 0;
-}
+++ /dev/null
-/*
- * ------------------------------------------------------------------------
- * File Name: debug.h
- * Author: Zhao Yanbai
- * 2018-07-26 15:47:46 Thursday CST
- * Description: none
- * ------------------------------------------------------------------------
- */
-
-#pragma once
-
-void debug();
-
-void asm_debug();
*/
#include<stdio.h>
#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;
}