LinuxMake抓頭檔案裡的變量 - LinuxHedy · 2013-02-06Table of ContentsPostCommentsRelated Posts 是這樣的 有個頭檔案叫 version.h #ifndef _VERSION_H_ #define _VERSION_H_ #define VERSION 0.1.16 #endif 在makefile 裡想去抓取VERSION的數值( 0.1.16),然後存在一個變量裡 (好比叫VERSION好了) 那請問要怎做呢? 試了很久還是不太行啊,對shell很不熟 有沒大大能幫一下的呢 謝謝 -- LinuxAll CommentsKama2013-02-06VER = $(shell grep '^#define VERSION' version.h | sed's/#define VERSION[ \t]*//g') 之類的...Ethan2013-02-07謝樓上Selena2013-02-08awk '/^#define VERSION/{print $3}' version.hRelated Posts用RedHat6 (64bit)架設vpn,無法正常連入ubuntu 12.10 youtube不能看Ubuntu 12.04工具列的icon怎麼移動?開啟終端機出現一行文字開啟終端機出現一行文字
All Comments