makefile execute another target

前端 未结 2 972
我在风中等你
我在风中等你 2020-12-23 00:12

I have a makefile structured something like this:

all : 
    compile executable

clean :
    rm -f *.o $(EXEC)

I realized that I was consis

2条回答
  •  一生所求
    2020-12-23 00:36

    If you removed the make all line from your "fresh" target:

    fresh :
        rm -f *.o $(EXEC)
        clear
    

    You could simply run the command make fresh all, which will execute as make fresh; make all.

    Some might consider this as a second instance of make, but it's certainly not a sub-instance of make (a make inside of a make), which is what your attempt seemed to result in.

提交回复
热议问题