Skip to content

Commit

Permalink
Improvement to @goal @glob #46
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Sep 18, 2021
1 parent 1833953 commit d40b0aa
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions makesure.awk
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,18 @@ function parseGoalLine( priv) {
return priv
}

function handleGoalGlob( goalName,priv,i) {
function handleGoalGlob( goalName,g,priv,i,pattern) {
started("goal_glob")
priv = parseGoalLine()
goalName = $2; $2 = ""
if ("@glob" == goalName) {
goalName = ""
} else $3 = ""
calcGlob(goalName, trim($0))
calcGlob(goalName, pattern = trim($0))
registerGoal(goalName = goalName ? goalName : pattern, priv)
for (i=0; i in GlobGoals; i++){
registerGoal(GlobGoals[i], priv)
registerDependency(goalName, g = GlobGoals[i])
registerGoal(g, 1)
}
}

Expand Down Expand Up @@ -278,11 +280,14 @@ function handleDependsOn( i) {
}
}

function registerDependsOn(goalName, i,x) {
for (i=2; i<=NF; i++) {
Dependencies[x = goalName SUBSEP DependenciesCnt[goalName]++] = $i
DependenciesLineNo[x] = NR
}
function registerDependsOn(goalName, i) {
for (i=2; i<=NF; i++)
registerDependency(goalName, $i)
}

function registerDependency(goalName, depGoalName, x) {
Dependencies[x = goalName SUBSEP DependenciesCnt[goalName]++] = depGoalName
DependenciesLineNo[x] = NR
}

function handleReachedIf( i) {
Expand Down

0 comments on commit d40b0aa

Please sign in to comment.