zoukankan      html  css  js  c++  java
  • iot_programe Makefile hacking

    /*****************************************************************************
     *                      iot_programe Makefile hacking
     * 说明:
     *     富林这边编写的demo,看一下其Makefile是怎么处理所有的源代码的,有生成动态、
     * 静态链接库,以及直接编译输出,其实模块化编译的模式还是很好的。
     *
     *                                           2017-8-12 深圳 龙华樟坑村 曾剑锋
     ****************************************************************************/
    
    
    一、参考文档:
        1. 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
  • 相关阅读:
    StatefulSet分段更新
    StatefulSet更新策略
    Deployment的伸缩扩容
    Deployment的暂停和恢复
    Deployment回滚
    Deployment更新
    Deployment
    Prestop之sleep 90不生效
    kubernetes coredns服务异常解决
    calico/node is not ready: BIRD is not ready: BGP not established with xxxxx
  • 原文地址:https://www.cnblogs.com/zengjfgit/p/7349142.html
Copyright © 2011-2022 走看看