A Makefile with Multiple Executables

前端 未结 4 1294
独厮守ぢ
独厮守ぢ 2020-11-22 13:48

I am trying to write a makefile which uses macros to create multiple executables from multiple files at once. I tried searching through previously answered questions but, be

4条回答
  •  被撕碎了的回忆
    2020-11-22 13:59

    You're close, but you need a pattern rule:

    $(EXECUTABLE): % : %.c
    

    And then a default rule to make it build both:

    all: $(EXECUTABLE)
    

提交回复
热议问题