Makefile目标:美元符号点o($ .o%.h:%。idl)

时间:2012-11-13 11:29:22

标签: makefile gnu-make

由于GNU make 3.82,另一个人写的Makefiles之一不再有效:

  

../../ PPB_ROOT / ppb-team.mk:238: * 混合隐式和普通规则。停止。

第238行:

$.o %.h : %.idl
    @echo Cleaning up previous output of idl...
    @-rm -f $@
    @echo Making $@...
    $(IDL_CMD)
    $(IDL_CXX_CMD)
    @ if [ "$(LOCAL_ORB)" != "OMNIORB" ]; then \
        $(OWN_MAKE) -f $(MAKEFILE) `basename '$*'`_skel.o; \
        $(AR) $(ARFLAGS) `basename '$*'`.a `basename '$*'`.o `basename '$*'`_skel.o; \
    else \
        $(AR) $(ARFLAGS) `basename '$*'`.a `basename '$*'`.o; \
    fi;

'$ .o'是什么意思?这是一个错字吗?

2 个答案:

答案 0 :(得分:3)

我想说这是一个类型,来自GNU make docs 4.2节:

http://www.gnu.org/software/make/manual/make.html

Because dollar signs are used to start make variable references, if you 
really want a dollar sign in a target or prerequisite you must write two
of them, ‘$$’ 

我怀疑它应该是

%.o %.h : %.idl

答案 1 :(得分:0)

这看起来是pattern rule that makes two targets(参见示例3)。所以,应该是:

%.o %.h : %.idl