Makefile: multiple goals, one dependency

I have a script that generates 2 code files (e.g. src1.c, src2.c) according to another file code (say origin.h).
I am using a makefile to create them.
Now I want the script to be executed when src1.c OR src2.c is older than origin.h.

What is the best way to do this?

Thank.

+3
source share
1 answer

Make src1.c and src2.c jointly dependent on origin.h:

src1.c src2.c : origin.h
        build-sources
+5
source

Source: https://habr.com/ru/post/1791954/


All Articles