zoukankan      html  css  js  c++  java
  • Makefile 基础语法

    01.. debug makefile(调试makefile)
    可以放在makefile 中的任何地方:开始的位置、工作目标或必要条件列表中以及命令脚本中。
    $(info debug_output_info_message)
    $(warning debug_output_warning_message_and_line_number)
    $(error debug_output_error_message_and_stop)
    带变量的调试信息
    $(info, CC is:$(CC) )

    02.. echo in makefile

    target … : prerequisitesrecipe

    echo只能在recipe这里用,且前面必须是个TAB。
    如:
    .DEFAULT:
      @echo "####make 009####"


    03.. specify the directores , i not specified , search current directory put every folder into a list
    SRCDIRS :=
    ifeq ($(SRCDIRS),)
    SRCDIRS := $(shell find $(SRCDIRS) -type d)

    04.. addprefix:
    作用是给每个string添加前缀,string之间用空格隔开。
    $(addprefix prefixstr, string1 string2 ...)
    如: $(addprefix chapters/, docx pdf jpg)

    05.. addsufix: 增加后缀;basename:取前缀;
    OBJS = $(addsuffix .o, $(basename $(SOURCES)))

    06..
    $(foreach <var>,<list>,<text>)
    這個函數的意思是,把參數<list>中的單詞逐一取出放到參數<var>所指定的變量中,然後再執行<text>所包含的表達式。每一次<text>會返回一個字符串,循環過程中,<text>的所返回的每個字符串會以空格分隔,最後當整個循環結束時,<text>所返回的每個字符串所組成的整個字符串(以空格分隔)將會是foreach函數的返回值。
    example:
    SRCEXTS = .cpp
    SOURCES = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(SRCEXTS))))
    HDREXTS = .h
    HEADERS = $(foreach d,$(SRCDIRS),$(wildcard $(addprefix $(d)/*,$(HDREXTS))))


  • 相关阅读:
    小白初学iOS中OTA部署(适应iOS7.1)
    CocoaPods管理本地库简单步骤
    CocoaPods问题记录
    UIPanGestureRecognizer下方法
    2013年度总结(反思篇)
    iOS7中cell的分割线右移的解决方法
    接触CocoaPods遇到的问题
    iOS摄像头问题
    iPhone4激活出错,菜鸟试验!!!!!
    详解UIPickerView
  • 原文地址:https://www.cnblogs.com/hkingsp/p/11764364.html
Copyright © 2011-2022 走看看