cbda8cd8 (kx 2023-04-06 10:27:37 +0300 1) #
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 2) # Wiki:
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 3) # ====
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 4) # https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/wiki
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 5) #
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 6) # GitHub:
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 7) # ======
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 8) # https://github.com/foss-for-synopsys-dwc-arc-processors
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 9) #
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 10) # Clone:
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 11) # =====
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 12) # git clone https://github.com/foss-for-synopsys-dwc-arc-processors/gcc.git
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 13) #
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 14)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 15) url = https://github.com/foss-for-synopsys-dwc-arc-processors
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 16)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 17) repo_name = gcc
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 18)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 19) #
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 20) # List of tags to be extracted:
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 21) # ============================
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 22) # hash | tag
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 23) # ----------------------------------------+-----
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 24) revisions = 051a4966a7c883a34b8612c0c1c7e2242c495a4e:arc-2016.09.17
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 25) revisions += d470d081a52fc51efc2b0391d44773d31821f674:arc-2018.09.12
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 26) revisions += b5a253d120b3fea698acbd35b185de06aabc03c6:arc-2020.03.16
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 27)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 28) git_repo = .git_clone
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 29)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 30) suffix = tar.xz
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 31)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 32) versions = $(foreach tag, $(revisions), $(shell echo $(tag) | cut -f 2 -d ':'))
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 33)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 34) tarballs = $(addsuffix .$(suffix), $(addprefix $(repo_name)-, $(versions)))
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 35) sha1s = $(addsuffix .sha1sum, $(tarballs))
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 36)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 37) TARGETS = repository_clean
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 38)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 39) all: $(TARGETS)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 40)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 41) .PHONY: downloads_clean repository_clean
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 42)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 43) $(git_repo):
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 44) @echo -e "\n======= Clone $(repo_name).git repository =======\n"
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 45) @rm -rf $(repo_name)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 46) @git clone $(url)/$(repo_name).git $(repo_name)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 47) @touch $@
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 48)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 49) $(tarballs): $(git_repo)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 50) @for revision in $(revisions) ; do \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 51) hash=`echo $$revision | cut -f 1 -d ':'` ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 52) version=`echo $$revision | cut -f 2 -d ':'` ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 53) if [ ! -f $(repo_name)-$$version.$(suffix) ]; then \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 54) echo -e "\n======= Creating '$(repo_name)-$$version.$(suffix)' snapshot =======" ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 55) ( cd $(repo_name) && \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 56) git archive --format=tar --prefix=$(repo_name)-$$version/ $$hash | \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 57) xz >../$(repo_name)-$$version.$(suffix) ) ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 58) fi ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 59) done
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 60)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 61) $(sha1s): %.$(suffix).sha1sum : %.$(suffix)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 62) @for tarball in $< ; do \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 63) echo -e "\n======= Calculation the '$$tarball' sha1sum =======" ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 64) sha1sum --binary $$tarball > $$tarball.sha1sum ; \
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 65) done
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 66)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 67) repository_clean: $(sha1s)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 68) @echo -e "\n======= Remove cloned $(repo_name).git repository =======\n"
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 69) @rm -rf $(git_repo) $(repo_name)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 70)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 71) downloads_clean:
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 72) @rm -rf $(tarballs) $(sha1s)
cbda8cd8 (kx 2023-04-06 10:27:37 +0300 73) @rm -rf $(git_repo) $(repo_name)