各位大大好,小弟想再这里请问一下
下方是我专案makefile,里面有大量重复的部份
utAtom: utAtom.o term.o
g++ -o [email protected] $^ -lgtest -lpthread
utAtom.o: utAtom.h atom.h
touch $*.cpp && echo "#include \"$*.h\"" > $*.cpp && cat utTemplate.h >>
$*.cpp
g++ -c $*.cpp
utTerm: utTerm.o term.o
g++ -o [email protected] $^ -lgtest -lpthread
utTerm.o: utTerm.h atom.h number.h variable.h
touch $*.cpp && echo "#include \"$*.h\"" > $*.cpp && cat utTemplate.h >>
$*.cpp
g++ -c $*.cpp
两组之间只差了ut****不一样而已,请问我该何把它缩短,用变量在执行的时候去读[email protected]
好像是不能读的,感谢各位了ꨊ