Skip to content

Commit 1b6e20c

Browse files
authored
Fix resolution of included files and search paths in minibook (#25)
1 parent 1824507 commit 1b6e20c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

source/learn/building_programs/project_make.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ $2 ~ /^["'].+["']$/ {
261261
# count included files per file to avoid having duplicates in our list
262262
if (incc[FILENAME,$2]++ == 0) {
263263
# Add the included file to our list, this might be case-sensitive
264-
inc[++ii] = sprintf("$(%s) += $(%s)", FILENAME, $2)
264+
inc[++ii] = sprintf("$(%s) += %s", FILENAME, $2)
265265
}
266266
}
267267

@@ -380,6 +380,10 @@ TEST_SRCS := src/tests/csv_read_test.f90 \
380380
src/tests/csv_test.f90 \
381381
src/tests/csv_write_test.f90
382382

383+
# Add source and tests directories to search paths
384+
vpath % .: src
385+
vpath % .: src/tests
386+
383387
# Define a map from each file name to its object file
384388
obj = $(src).o
385389
$(foreach src, $(SRCS) $(TEST_SRCS), $(eval $(src) := $(obj)))

0 commit comments

Comments
 (0)