help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: any example on "Generating Prerequisites Automatically"?


From: Mason
Subject: Re: any example on "Generating Prerequisites Automatically"?
Date: Tue, 12 Jun 2012 10:06:44 +0200
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20120429 Firefox/12.0 SeaMonkey/2.9.1

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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]