diff options
author | Freeyorp <TheFreeYorp+git@gmail.com> | 2024-06-05 23:46:21 +0000 |
---|---|---|
committer | Freeyorp <TheFreeYorp+git@gmail.com> | 2024-06-05 23:57:13 +0000 |
commit | 6a3ded9d3c85e54a5a008ba2f125520c63cfb641 (patch) | |
tree | 5ff75fa1ea16ba545cb1c0e45f522c1e7ed3cf65 | |
parent | f928d23f106f19ab9f2ccd5d57a5728f66ccb17f (diff) | |
download | tmwa-6a3ded9d3c85e54a5a008ba2f125520c63cfb641.tar.gz tmwa-6a3ded9d3c85e54a5a008ba2f125520c63cfb641.tar.bz2 tmwa-6a3ded9d3c85e54a5a008ba2f125520c63cfb641.tar.xz tmwa-6a3ded9d3c85e54a5a008ba2f125520c63cfb641.zip |
real.make: Permit existant SRC_DIR relative paths
This allows files that already exist to be specified relative to SRC_DIR,
rather than just relative to the current file.
This is used in tests, though it appears not to be used in main tmwa.
-rw-r--r-- | Makefile.in | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile.in b/Makefile.in index 2f62baf..2b0c632 100644 --- a/Makefile.in +++ b/Makefile.in @@ -372,13 +372,17 @@ $(foreach root,${PATTERN_ROOTS},$(eval \ # Secondly, make sure that the files actually exist, or are files we expect to # generate ourselves. Sort the result for readability. -# Note that we re-add and remove the ${SRC_DIR} prefix when testing for +# Note that we re-add and remove the ${SRC_DIR} prefix when first testing for # existence, as we need to test for existence relative to our build directory. +# The second wildcard test doesn't add a ${SRC_DIR} prefix, but does strip it, +# handling the case where the file is specified relative to the source +# directory (mostly the case in test sources). $(foreach root,${PATTERN_ROOTS},$(eval \ ${root} := $(sort \ $(patsubst ${SRC_DIR}/%,%,$(wildcard $(addprefix ${SRC_DIR}/, \ $(value ${root}) \ ))) \ + $(patsubst ${SRC_DIR}/%,%,$(wildcard ${SRC_DIR})) \ $(filter conf-raw/%.h,$(value ${root})) \ $(filter ${GENERATED_FILES},$(value ${root})) \ ) \ @@ -738,7 +742,7 @@ conf-raw/str-%.h: FORCE FORCE:: ; .PHONY: FORCE -override CPPFLAGS += -I. -I${SRC_DIR}/include +override CPPFLAGS += -I. -I${SRC_DIR} -I${SRC_DIR}/include # distribution tarballs # this only works from within a git checkout |