Skip to content

Commit 35e0663

Browse files
authored
fix dependency of include files under learn/building_programs mini-book (fortran-lang#400)
* fix dependency of include files * support zeros in these regex
1 parent e4b5705 commit 35e0663

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

learn/building_programs/project_make.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ BEGIN {
228228
# - the first argument ($1) should be the whole word module
229229
# - the second argument ($2) should be a valid module name
230230
$1 ~ /^module$/ &&
231-
$2 ~ /^[a-zA-Z][a-zA-Z1-9_]*$/ {
231+
$2 ~ /^[a-zA-Z][a-zA-Z0-9_]*$/ {
232232
# count module names per file to avoid having modules twice in our list
233233
if (modc[FILENAME,$2]++ == 0) {
234234
# add to the module list, the generated module name is expected
@@ -241,7 +241,7 @@ $2 ~ /^[a-zA-Z][a-zA-Z1-9_]*$/ {
241241
# - the first argument ($1) should be the whole word use
242242
# - the second argument ($2) should be a valid module name
243243
$1 ~ /^use$/ &&
244-
$2 ~ /^[a-zA-Z][a-zA-Z1-9_]*,?$/ {
244+
$2 ~ /^[a-zA-Z][a-zA-Z0-9_]*,?$/ {
245245
# Remove a trailing comma from an optional only statement
246246
gsub(/,/, "", $2)
247247
# count used module names per file to avoid using modules twice in our list
@@ -262,7 +262,7 @@ $2 ~ /^["'].+["']$/ {
262262
# count included files per file to avoid having duplicates in our list
263263
if (incc[FILENAME,$2]++ == 0) {
264264
# Add the included file to our list, this might be case-sensitive
265-
inc[++ii] = sprintf("$(%s) += %s", FILENAME, $2)
265+
inc[++ii] = sprintf("$(%s) += $(%s)", FILENAME, $2)
266266
}
267267
}
268268

0 commit comments

Comments
 (0)