Makefile compile only the first file one makefile instructions

前端 未结 2 1248
故里飘歌
故里飘歌 2021-01-23 12:33
f1: f1.cpp f.h  
    g++ -c -Wall -g f1.cpp

f2: f2.cpp f.h  
    g++ -c -Wall -g f.cpp

This makefile does not compile f2.cpp to f2.

2条回答
  •  南方客
    南方客 (楼主)
    2021-01-23 12:39

    Is this the entire contents of your Makefile? If yes, then you're missing the all rule.

    all: f1 f2
    
    f1: dependencies
        intructions
    
    f2: dependencies
        intructions
    

提交回复
热议问题