[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Canonical method of rebuilding makefiles?
From: |
Miller, Bryan |
Subject: |
Canonical method of rebuilding makefiles? |
Date: |
Wed, 6 Mar 2002 20:40:08 -0800 |
Hello all,
I have read and re-read section 3.5 "How Makefiles are Remade" in the GNU
make manual but I am still wrestling with correctly rebuilding a makefile to
include updated dependency files. When I turn on -d I can see the makefile
being regenerated and the include files being read but I am not able to see
the updated variables.
#-----------------------------------------------
.PHONY: all
-include base_deps.mk
-include app_deps.mk
all: base_deps.mk
@echo $(app_deps)
# regenerate the dependency files...
base_deps.mk:
cqperl get_depends.pl
#-----------------------------------------------
The *_deps.mk files are generated by get_depends.pl. Since they need to be
generated everytime I have added one of them as a dependency to the default
target. If both files exist I get an echo of the string app_deps which is
defined in app_deps.mk. If the files don't exist "cqperl get_depends.pl"
gets run and generates the files but the echo statement echos an empty
string ("").
Is there a better way to do this (double colon rule?)? I have read section
3.5 (How Makefiles are Remade) of the GNU Make book (3.77) but it really
muddies the waters quite a bit. It suggests that make will consider all
makefiles (and include.mk files) as targets and will rebuild them if a rule
is provide. I have not found that to be true in clearmake GNU compat mode.
(NOTE: I have taken the makefile rule out in the above example.)
Cheers,
Bryan
- Canonical method of rebuilding makefiles?,
Miller, Bryan <=