/*****************************************************************************
* 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. Material Design学习之 Camera

    转载请注明出处:王亟亟的大牛之路 年后第一篇,自从来了某司产量骤减,这里批评下自己,这一篇的素材来源于老牌Material Design控件写手afollestad的 https://github.c ...

  2. centos7更改主机名

    操作环境 [root@centos701 ~]# uname Linux [root@centos701 ~]# uname -a Linux centos701 3.10.0-693.el7.x86 ...

  3. mybatis动态sql中的bind绑定

    知识点:bind在模糊查询中的用法 在我的博客    mybatis中使用mysql的模糊查询字符串拼接(like) 中也涉及到bind的使用 <!-- List<Employee> ...

  4. Kubernetes 部署失败的 10 个最普遍原因

    [原文].后面我们可能还会看到一个 OOMKilled 错误. 我们的应用正在挂掉?为什么? 首先我们查看应用日志.假定你发送应用日志到 stdout(事实上你也应该这么做),你可以使用 kubect ...

  5. Interleaving String,交叉字符串,动态规划

    问题描述: Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example,Give ...

  6. session判断重复提交

    import javax.servlet.http.HttpServletRequest; /** * @author: jiang * @Date: 2019/2/19 09:37 * @Descr ...

  7. KVM与XEN虚拟化环境究竟有何不同

    虚拟化的概念在近些年收到了很大程度上的普及,求其原因很简单:虚拟化能够最大程度利用资源,为企业节约成本.目前市面较受欢迎的虚拟架构主要有KVM.XEN和VMware,其中,KVM和XEN都是免费开源的 ...

  8. Pytorch入门笔记

    import torch.nn as nn import torch.nn.functional as F class Net(nn.Module): def __init__(self): #nn. ...

  9. Highcharts 基本曲线图;Highcharts 带有数据标签曲线图表;Highcharts 异步加载数据曲线图表

    Highcharts 基本曲线图 实例 文件名:highcharts_line_basic.htm <html> <head> <meta charset="U ...

  10. JDK的BIO, NIO, AIO

    背景知识点我 1. BIO JDK5之前, JDK的IO模式只有BIO(同步阻塞)问题: 因为阻塞的存在, 需对每个请求开启一个线程. 过多的线程切换影响操作系统性能解决: 使用线程池, 处理不过来的 ...