From 487db287f8bbc97c794e63a3aea54ba4f25b633a Mon Sep 17 00:00:00 2001 From: Freeyorp Date: Wed, 5 Jun 2024 18:32:09 +0000 Subject: real.make: Split dependency sanitization step If we want to be able to filter specific other entries, such as for the sake of more generated files, we'll want to be doing this over a list that has already been made relative and simplified. --- Makefile.in | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index a63a589..f9f1fed 100644 --- a/Makefile.in +++ b/Makefile.in @@ -358,15 +358,23 @@ thisdir := $(abspath .) # The end result for each root will look something like: # mmo/version := conf-raw/int-VENDOR_POINT.h conf-raw/int-VERSION_DEVEL.h [...] # src/strings/zstring.tcc src/wire/fwd.hpp + +# Firstly, make the paths relative and simplified. $(foreach root,${PATTERN_ROOTS},$(eval \ ${root} := $(sort $(patsubst ${thisdir}/%,%, \ - $(abspath $(patsubst ${SRC_DIR}/%,%, \ - $(wildcard $(value ${root})) \ - $(filter conf-raw/%.h,$(value ${root}) \ - ))) \ + $(abspath $(patsubst ${SRC_DIR}/%,%, $(value ${root}))) \ )) \ )) +# Secondly, make sure that the files actually exist, or are files we expect to +# generate ourselves. Sort the result for readability. +$(foreach root,${PATTERN_ROOTS},$(eval \ + ${root} := $(sort \ + $(wildcard $(value ${root})) \ + $(filter conf-raw/%.h,$(value ${root})) \ + ) \ +)) + # have to redo what we undid to get it as a variable $(foreach root,${PATTERN_ROOTS},$(eval obj/${root}.ii obj/${root}.ll obj/${root}.bc obj/${root}.s obj/${root}.pdc.o obj/${root}.pic.o obj/${root}.d : $(value ${root})) ) #$(foreach root,${PATTERN_ROOTS},$(info post-root: ${root} := $(value ${root}))$(info )) -- cgit v1.2.3-70-g09d2