From: Carl Worth Date: Fri, 5 Jun 2020 17:09:52 +0000 (-0700) Subject: Makefile: Fix downloading of React javascript files X-Git-Url: https://git.cworth.org/git?p=lmno.games;a=commitdiff_plain;h=6126dc41b242fe413fd212d3de0fba73b23011da Makefile: Fix downloading of React javascript files This has not worke since commit b5bcbc45f19ee068478edb73b48bc7194e582da8 There were two things broken in that commit: 1. It was inserting a "deps/" into the URL for downloading, (which doesn't exist---we only have "deps/" in the local filesystem. 2. It wasn't distinguishing "react-dom@16" from "react@16" in the URL, (half of the files we download need one, and half the other). This commit fixes both. The first by using a "substitution reference" with the $@ variable to remove the "deps/" from its value when constructing the URL. And the second by splitting the existing rule into two rules. Whle here, we also replace the use of the patsubt function in the SHA512 recipe with the simpler substitution reference exactly as we are now using it in the line before. --- diff --git a/Makefile b/Makefile index cf1e1d7..4132e96 100644 --- a/Makefile +++ b/Makefile @@ -75,9 +75,13 @@ deps: $(REACT_DOWNLOADS) $(call quiet,SHA512) deps/*.sha512 DOWNLOAD=wget $(WGET_VERBOSE_FLAGS) -nc -P deps -deps/%.js: - $(call quiet,DOWNLOAD) https://unpkg.com/react@16/umd/$@ - $(call quiet,SHA512) $(patsubst %,%.sha512,$@) +deps/react.%.js: + $(call quiet,DOWNLOAD) https://unpkg.com/react@16/umd/$(@:deps/%=%) + $(call quiet,SHA512) $(@:%=%.sha512) + +deps/react-dom.%.js: + $(call quiet,DOWNLOAD) https://unpkg.com/react-dom@16/umd/$(@:deps/%=%) + $(call quiet,SHA512) $(@:%=%.sha512) deploy: rm -rf .deploy-source