Iterating over lists in Makefiles?

后端 未结 6 1518
一整个雨季
一整个雨季 2020-12-31 11:45

I find I\'m writing a lot of Makefiles that could be cleaned up with the use of n-tuple lists. But I can\'t find any way to do this properly (and cleanly). So far I

6条回答
  •  萌比男神i
    2020-12-31 12:14

    You're doing it backwards.

    You're trying to treat make like it's a script. It's not, instead its a set of rules on how to create X given Y. Then the make engine figures out what needs to happen to get that result.

    For the example given, you really should be using a script for the generation steps. Perhaps calling that from make, but let make handle the CC stuff.

提交回复
热议问题