以下生成文件:
#Regular c++ rules
CXX=g++
CXXFLAGS=-Wall -march=native -ffast-math -O3
CXX_OBJECTS=AbsNode.o rle16.o rle8.o
# Link command:
test : $(CXX_OBJECTS)
$(CXX) $(CXX_OBJECTS) -o test
# Compilation commands:
$.o : %.cpp
$(CXX) -c $< $(CXXFLAGS) -o $@
输出
g++ -Wall -march=native -ffast-math -O3 -c -o AbsNode.o AbsNode.cpp
g++ -Wall -march=native -ffast-math -O3 -c -o rle16.o rle16.cpp
g++ -Wall -march=native -ffast-math -O3 -c -o rle8.o rle8.cpp
虽然我期待
g++ -c AbsNode.cpp -Wall -march=native -ffast-math -O3 -o AbsNode.o
g++ -c rle16.cpp -Wall -march=native -ffast-math -O3 -o rle16.o
g++ -c rle8.cpp -Wall -march=native -ffast-math -O3 -o rle8.o
为什么与makefile中所述的规则相比,g ++的参数顺序切换了???