/*****************************************************************************
* iot_programe Makefile hacking
* 说明:
* 富林这边编写的demo,看一下其Makefile是怎么处理所有的源代码的,有生成动态、
* 静态链接库,以及直接编译输出,其实模块化编译的模式还是很好的。
*
* 2017-8-12 深圳 龙华樟坑村 曾剑锋
****************************************************************************/ 一、参考文档:
. Linux GCC编译使用动态、静态链接库
http://blog.csdn.net/a600423444/article/details/7206015 二、Makefile
all:
make -C gpio_led/main all
... clean:
make -C gpio_led/main clean
... 三、gpio_led/main/Makefile
CC = arm-linux-gnueabihf-gcc all:
make -C ../src
# use share library
$(CC) main.c -o gpio_led -L ../src/ -lgpio_led # directory compile with source code
$(CC) main.c ../src/gpio_led.c -o my_gpio_led clean:
rm gpio_led my_gpio_led -rf
make -C ../src clean 四、gpio_led/src/Makefile
CC = arm-linux-gnueabihf-gcc
AR = arm-linux-gnueabihf-ar all:
# output share library
$(CC) gpio_led.c -fPIC -shared -o libgpio_led.so # output static library
$(CC) -c gpio_led.c -o libgpio_led.o -I ../include
$(AR) rcv libgpio_led.a libgpio_led.o clean:
rm *.so *.o *.a

iot_programe Makefile hacking的更多相关文章

  1. ti processor sdk linux am335x evm Makefile hacking

    # # ti processor sdk linux am335x evm Makefile hacking # 说明: # 本文主要对TI的sdk中的Makefile脚本进行解读,是为了了解其工作机 ...

  2. I.MX6 U-Boot mkconfig hacking

    /**************************************************************************** * I.MX6 U-Boot mkconfi ...

  3. Makefile 變數替換

    Makefile SUBDIRS = xxx aaa BUILDSUBDIRS = $(SUBDIRS:%=build-%) CLEANSUBDIRS = $(SUBDIRS:%=clean-%) . ...

  4. Linux kernel config and makefile system

    转载自:http://blog.csdn.net/dreamxu/article/details/6125545 http://www-900.ibm.com/developerWorks/cn/li ...

  5. LibOpenCM3(二) 项目模板 Makefile分析

    目录 LibOpenCM3(一) Linux下命令行开发环境配置 LibOpenCM3(二) 项目模板 Makefile分析 LibOpenCM3 项目模板 项目模板地址: https://githu ...

  6. 说说Makefile那些事儿

    说说Makefile那些事儿 |扬说|透过现象看本质 工作至今,一直对Makefile半知半解.突然某天幡然醒悟,觉得此举极为不妥,只得洗心革面从头学来,以前许多不明觉厉之处顿时茅塞顿开,想想好记性不 ...

  7. 编写一个通用的Makefile文件

    1.1在这之前,我们需要了解程序的编译过程 a.预处理:检查语法错误,展开宏,包含头文件等 b.编译:*.c-->*.S c.汇编:*.S-->*.o d.链接:.o +库文件=*.exe ...

  8. 编写简单的Makefile文件

    makefile中的编写内容如下: www:hello.c x.h gcc hello.c -o hello clean: rm hello www:hello.c  x.h 表示生成www这个文件需 ...

  9. ★Kali信息收集~ 1.Google Hacking + Github Hacking

    一.google hacking site site:cnblogs.com 毒逆天 intitle intitle:login allintitle allintitle:index of alli ...

随机推荐

  1. Linux crontab命令 定时任务 用法详解以及no crontab for root解决办法

    最近系统服务器进行搬迁,又恰好需要使用定时任务运行程序,而我的程序主要使用PHP写的,然后总结了下定时任务的用法,但是在这里主要写的是关于crontab命令的用法,使用过程中遇到不少问题,例如no c ...

  2. Object.defineProperties——MEAN开发后台的Model层

    Object.defineProperties是什么?有什么用? 这个问题比较听起来可能比较难以理解,确实我也是在项目中遇到的才会去想.以前看到<高级程序设计>的时候,有这么一种东西,定义 ...

  3. ThinkPHP的URL重写时遇到No input file specified的解决方法

    因为在Fastcgi模式下,php不支持rewrite的目标网址的PATH_INFO的解析 ThinkPHP运行在URL_MODEL=2时,会出现 No input file specified.的情 ...

  4. Asp.Net MVC 缓存设计

    Asp.Net MVC 缓存: 1. 可以直接在Controller,Action上面定义输出缓存OutputCache,如下,第一次请求这个Index的时候,里面的代码会执行,并且结果会被缓存起来, ...

  5. Restore IP Addresses,将字符串转换成ip地址

    问题描述: Given a string containing only digits, restore it by returning all possible valid IP address c ...

  6. zabbix自动化运维学习笔记(服务器配置)

    继上次博主整理的安装后,这次是配置步骤 首先打开zabbix的安装web地址   http://xx.xx.xx.xx/zabbix/setup.php  xx.xx.xx.xx是服务器的IP地址 由 ...

  7. nginx页面不能正常访问排除方法

    nginx页面不能访问 nginx页面不能访问 检查服务端服务是否启动成功 在服务端使用wget和curl测试下返回的是否正常 浏览器wget或者curl等软件访问不了Ngixn页面 1. 检查服务端 ...

  8. HDU5137-最短路-删点

    How Many Maos Does the Guanxi Worth Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 512000/5 ...

  9. Python中实现switchcase

    # 第一种方式使用python中的字典# author:wanstack def first_func(): print('first_func') def second_func(): print( ...

  10. 实现Callable接口创建线程

    创建执行线程有四种方式: 实现implements接口创建线程 继承Thread类创建线程 实现Callable接口,通过FutureTask包装器来创建线程 使用线程池创建线程 下面介绍通过实现Ca ...