[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNU make 3.80] Why does "make" "order-only-prequisities" work oddly wit
From: |
for . fun |
Subject: |
[GNU make 3.80] Why does "make" "order-only-prequisities" work oddly with stems ? |
Date: |
7 Dec 2005 03:36:38 -0800 |
User-agent: |
G2/0.2 |
Hi everybody,
First of all, I understood this about "order-only-prequisities" :
If a rule only depends on an order only requisities, it means that the
target will only be rebuilt upon the prequisity existence condition
(instead of the modified time condition)
I joined the short Makefile "order-only.mk" and a script which runs
this Makefile. This should reproduce the strange behaviour I noticed.
After cutting/pasting the followings lines respectively into
"order-only.mk" and "test.sh" files, you should get the following
result after running "test.sh" (be carefull that "oo-prereq" time is
really newer than the target in case your system time is not accurate)
:
*** First build ***
"Making test.out ..."
"Making test-stem.out ..."
*** Build after order only prerequisity is modified ***
"Making test-stem.out ..."
As expected, the target "test.out" is not rebuilt but "test-stem.out"
is rebuilt in spite of the fact that "oo-prereq" is order only.
If you run "make" in verbose mode ("-d" option), you will notice that
in the "stem" case, the order only prereq is recognized as a regular
target so make rebuild the target.
=> Please tell me if I misunderstood anything ?
=> Does my "order-only.mk" contains some error ?
=> Is it a GNU make 3.80 bug ?
Thanks in advance for your help.
------------------------- order-only.mk -------------------------
all: test.out test-stem.out
test.out: test.in | oo-prereq
@echo "Making
$@ ..."
@touch $@
%-stem.out: %-stem.in | oo-prereq
@echo "Making
$@ ..."
@touch $@
-----------------------------------------------------------------
---------------------------- test.sh ----------------------------
#/bin/sh
rm -f test.in test-stem.in test.out test-stem.out
echo "*** First build ***"
touch test.in test-stem.in oo-prereq
make -f order-only.mk
echo "*** Build after order only prerequisity is modified ***"
touch oo-prereq
make -f order-only.mk
-----------------------------------------------------------------
- [GNU make 3.80] Why does "make" "order-only-prequisities" work oddly with stems ?,
for . fun <=