On Mon, Jan 13, 2025 at 11:00:09AM +0100, Jakub Jelinek wrote: > Why do you need there the directory or suffix? > $(*F) is clearly bad, because there are rules like > d/%.o: d/dmd/%.d > $(DCOMPILE) $(D_INCLUDES) $< > $(DPOSTCOMPILE) > > d/common-%.o: d/dmd/common/%.d > $(DCOMPILE) $(D_INCLUDES) $< > $(DPOSTCOMPILE) > etc. and while the stem in the first case is the basename of the filename > part, in the second case it is the basename of the filename part in the > common directory. > I think > DEPFILE = $(basename $(@F)) > would be sufficient. > So the former d/.deps/file.Po which handled both d/dmd/common/file.d and > d/dmd/root/file.d in your case would be d/.deps/d-common-file.o.d and > d/.deps/d-root-file.o.d while with the above DEPFILE it would be > d/.deps/common-file.d and d/.deps/root-file.d > There are no d/dmd/*-*.d files and among d/*-*.cc the only are just d- > prefixed ones, and there are no clashes between the *.cc and *.d filenames: > for i in gcc/d/*.cc; do j=`basename $i .cc`; find gcc/d -name $j.d; done
And note, the filenames better be unique, as if they weren't, multiple sources would use the same object file d/$(basename $(@F)).o Jakub