Den sön 20 okt. 2024 kl 17:44 skrev Nathan Hartman <hartman.nat...@gmail.com >:
> However please note that this makefile is used by creating a symlink to it >>> (see example usage in adjacent readme) so factoring to a separate file may >>> require a second symlink or other handling. Unless we're talking about >>> thousands of lines of SHA256 sums, I'd rather leave it as one file -- but >>> this is only my opinion given my current understanding (or lack of >>> understanding) of your idea. >>> >> >> Correctly noted - this was the "breaking change" referenced above. The >> existing users would have to remove that symlink and instead `cp >> unix-build/Makefile.tmpl Makefile` >> > > > Does anything now prevent copying, rather than symlinking, the makefile? > Not really - although it makes committing changes slightly more difficult. I'm aiming for a workflow where switching between different dependency version won't make the file show up as changed, but making actual changes (for example, conditional patching for different dependency versions) will show up. > I also explored keeping the symlink and instead `include Makefile.ver`, >> but it seems Make is creating the targets before reading the included file, >> so the target $(PYTHON_OBJDIR)/.retrieved, where PYTHON_OBJDIR = >> $(OBJDIR)/python-$(PYTHON_VER), will be expanded without a version number. >> > > > Wait, make reads targets before includes? That doesn't sound right. > > According to the GNU Make manual, "The include directive tells make to > suspend reading the current makefile and read one or more other makefiles > before continuing." [1] > > Perhaps something else made it appear that targets were read first? > Variables didn't end up being set due to some syntax error? Wrong file got > included? > Yup, my mistake, please disregard. I tried to make it smart by automatically creating Makefile.ver if it didn't already exist. So the error message I got was from the first run, when Makefile.ver didn't exist. It complained about duplicated targets and then created Makefile.ver. On the second run, when Makefile.ver existed, it functioned correctly. On second thoughts, I made it much simpler. I'll just include a Makefile.local after all the _VER variables, so if I want another Ruby version I'll just set it in that file. If it doesn't exist, the default version will be used Thanks also to Stefan for valuable input! Cheers, Daniel