diff --git a/makesure.awk b/makesure.awk index 0d75b8a..e4fec09 100755 --- a/makesure.awk +++ b/makesure.awk @@ -264,7 +264,8 @@ function handleGoalGlob( goalName,globAllGoal,globSingle,priv,i,pattern,nfMax, registerGoal(globSingle ? priv : 1, gi = globGoal(i)) for (j = 0; j in globPgParams; j++) GoalParams[gi, GoalParamsCnt[gi]++] = globPgParams[j] - } if (!globSingle) { # glob on single file + } + if (!globSingle) { # glob on single file registerGoal(priv, globAllGoal) for (j = 0; j in globPgParams; j++) GoalParams[globAllGoal, GoalParamsCnt[globAllGoal]++] = globPgParams[j] diff --git a/tests/29_glob_plus_pg.tush b/tests/29_glob_plus_pg.tush index 00ef160..09a9a37 100644 --- a/tests/29_glob_plus_pg.tush +++ b/tests/29_glob_plus_pg.tush @@ -9,6 +9,22 @@ $ ./$MAKESURE -f tests/29_glob_plus_pg_1.sh -l | g3pg@salut | gpg@salut +$ ./$MAKESURE -f tests/29_glob_plus_pg_1.sh -la +| Available goals: +| g1 +| g2 +| g3 +| gpg@hello +| gpg@glob_test/1.txt@hello +| gpg@glob_test/2.txt@hello +| gpg@hi +| gpg@glob_test/1.txt@hi +| gpg@glob_test/2.txt@hi +| g3pg@salut +| gpg@salut +| gpg@glob_test/1.txt@salut +| gpg@glob_test/2.txt@salut + $ ./$MAKESURE -f tests/29_glob_plus_pg_1.sh g1 | goal 'gpg@glob_test/1.txt@hello' ... | glob_test/1.txt hello @@ -49,6 +65,22 @@ $ ./$MAKESURE -f tests/29_glob_plus_pg_2.sh -l | g3pg@salut | 'glob_test/*.txt@salut' +$ ./$MAKESURE -f tests/29_glob_plus_pg_2.sh -la +| Available goals: +| g1 +| g2 +| g3 +| 'glob_test/*.txt@hello' +| glob_test/1.txt@hello +| glob_test/2.txt@hello +| 'glob_test/*.txt@hi' +| glob_test/1.txt@hi +| glob_test/2.txt@hi +| g3pg@salut +| 'glob_test/*.txt@salut' +| glob_test/1.txt@salut +| glob_test/2.txt@salut + $ ./$MAKESURE -f tests/29_glob_plus_pg_2.sh g1 | goal 'glob_test/1.txt@hello' ... | glob_test/1.txt hello @@ -78,3 +110,41 @@ $ ./$MAKESURE -f tests/29_glob_plus_pg_2.sh g3 | goal 'glob_test/*.txt@salut' [empty]. | goal 'g3pg@salut' [empty]. | goal 'g3' [empty]. + +$ ./$MAKESURE -f tests/29_glob_plus_pg_3.sh -l +| Available goals: +| g1 +| g2 +| g3 +| glob_test/1.txt@hello +| glob_test/1.txt@hi +| g3pg@salut +| glob_test/1.txt@salut + +$ ./$MAKESURE -f tests/29_glob_plus_pg_3.sh -la +| Available goals: +| g1 +| g2 +| g3 +| glob_test/1.txt@hello +| glob_test/1.txt@hi +| g3pg@salut +| glob_test/1.txt@salut + +$ ./$MAKESURE -f tests/29_glob_plus_pg_3.sh g1 +| goal 'glob_test/1.txt@hello' ... +| glob_test/1.txt hello +| goal 'g1' [empty]. + +$ ./$MAKESURE -f tests/29_glob_plus_pg_3.sh g2 +| goal 'glob_test/1.txt@hello' ... +| glob_test/1.txt hello +| goal 'glob_test/1.txt@hi' ... +| glob_test/1.txt hi +| goal 'g2' [empty]. + +$ ./$MAKESURE -f tests/29_glob_plus_pg_3.sh g3 +| goal 'glob_test/1.txt@salut' ... +| glob_test/1.txt salut +| goal 'g3pg@salut' [empty]. +| goal 'g3' [empty]. diff --git a/tests/29_glob_plus_pg_3.sh b/tests/29_glob_plus_pg_3.sh new file mode 100644 index 0000000..67e1487 --- /dev/null +++ b/tests/29_glob_plus_pg_3.sh @@ -0,0 +1,16 @@ + +@goal @glob 'glob_test/1.txt' @params P + echo "$ITEM $P" + +@goal g1 +@depends_on 'glob_test/1.txt' @args 'hello' + +@goal g2 +@depends_on 'glob_test/1.txt' @args 'hello' +@depends_on 'glob_test/1.txt' @args 'hi' + +@goal g3 +@depends_on g3pg @args 'salut' + +@goal g3pg @params X +@depends_on 'glob_test/1.txt' @args X