随笔分类 - makefile&CMAKE
linux下makefile以及CMAKE的总结,
摘要:目录树 ➜ test_pro6 tree -h . ├── [1.0K] CMakeLists.txt ├── [4.0K] app_hello │ ├── [ 794] CMakeLists.txt │ ├── [ 280] app_hello.c │ └── [ 218] app_hello.h
阅读全文
摘要:通过多个cmake层级编译 目录树 ➜ test_pro6 tree -h . ├── [ 351] CMakeLists.txt ├── [4.0K] app_hello │ ├── [ 97] CMakeLists.txt │ ├── [ 280] app_hello.c │ └── [ 218
阅读全文
摘要:cmake的常用函数 cmake_minimum_required(VERSION 3.0) #指定cmake的最小版本 project(demo) # 设置项目名称 add_executable(demo demo.cpp) # 生成可执行文件 demo.cpp 可以是一系列文件的集合 add_l
阅读全文
摘要:通过makefile生成静态库和动态库 目录树 ➜ app_hello tree -h . ├── [ 280] app_hello.c ├── [ 218] app_hello.h └── [ 997] makefile 0 directories, 3 files makefile ROOT_D
阅读全文
摘要:通过多个层级的makefile构建整个工程级别的makefile,大工程如果不使用cmake等,基本如此组织, linux内核也是这样哈 目录树 ➜ test_pro3 tree -h . ├── [4.0K] app_1 │ ├── [ 272] app1.c │ ├── [ 248] app1.
阅读全文
摘要:单makefile 构建多个目录的工程适用于构建稍微复杂一些的工程 目录树如下 ➜ test_pro2 tree -h . ├── [4.0K] app_1 │ ├── [ 272] app1.c │ └── [ 225] app1.h ├── [4.0K] app_2 │ ├── [ 270] a
阅读全文
摘要:使用单个makefile构建单目录的工程适用于一些简单的测试场景 目录树如下 ➜ test_pro tree -h . └── [4.0K] test_pro1 ├── [ 800] Makefile ├── [ 287] hello1.c └── [ 223] hello1.h 1 directo
阅读全文
摘要:makfile的常用函数 下面的常用函数掌握以下,也不用记得住,用时候过来取就行,基本就没问题了 $(wildcard *.c) #同一类型的文件 *.h *.cpp等 $(wildcard $(SRC)/*.c) #同一类型的文件 *.h *.cpp等 $(patsubst *.c, *.o, $
阅读全文
摘要:# cmake 版本 cmake_minimum_required(VERSION 3.5.1) project(test) # name set(PROJECT_NAME test) option(ARM32"option for ARM" OFF) # set cmake cross compi
阅读全文