Michael Chen wrote:

> Anyone has an example on Generating Prerequisites Automatically:

If you're using GCC, take a look at the -M* family of options.

For example, I use -MMD.
It will store the dependency file with the object file.

My main recipe looks like this:

OBJDIR := obj/foo/
$(OBJDIR)%.o: src/%.c
        $(CC) -c $(CFLAGS) -MMD $< -o $@

-- 
Regards.

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to