# # Project Home: # ============ # https://llvm.org # # GitHub: # ====== # https://github.com/llvm/llvm-project # # Clone: # ===== # https://github.com/llvm/llvm-project.git # url = https://github.com/llvm repo_name = llvm-project pkg_name = llvm # # List of tags to be extracted: # ============================ # hash | tag # ----------------------------------------+----- revisions = 1fdec59bffc11ae37eb51a1b9869f0696bfd5312:11.1.0 revisions += d28af7c654d8db0b68c175db5ce212d74fb5e9bc:12.0.0 revisions += fed41342a82f5a3a9201819a82bf7a48313e296b:12.0.1 revisions += d7b669b3a30345cfcdb2fde2af6f48aa4b94845d:13.0.0 revisions += 5c68a1cb123161b54b72ce90e7975d95a8eaf2a4:15.0.4 revisions += 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a:15.0.7 revisions += cd89023f797900e4492da58b7bed36f702120011:16.0.1 revisions += 18ddebe1a1a9bde349441631365f0472e9693520:16.0.2 revisions += 6009708b4367171ccdbf4b5905cb6a803753fe18:17.0.6 git_repo = .git_clone suffix = tar.xz versions = $(foreach tag, $(revisions), $(shell echo $(tag) | cut -f 2 -d ':')) tarballs = $(addsuffix .$(suffix), $(addprefix $(pkg_name)-, $(versions))) sha1s = $(addsuffix .sha1sum, $(tarballs)) TARGETS = repository_clean all: $(TARGETS) .PHONY: downloads_clean repository_clean $(git_repo): @echo -e "\n======= Clone $(repo_name).git repository =======\n" @rm -rf $(repo_name) @git clone $(url)/$(repo_name).git $(repo_name) @touch $@ $(tarballs): $(git_repo) @for revision in $(revisions) ; do \ hash=`echo $$revision | cut -f 1 -d ':'` ; \ version=`echo $$revision | cut -f 2 -d ':'` ; \ if [ ! -f $(repo_name)-$$version.$(suffix) ]; then \ echo -e "\n======= Creating '$(pkg_name)-$$version.$(suffix)' snapshot =======" ; \ ( cd $(repo_name) && \ git archive --format=tar --prefix=$(pkg_name)-$$version/ $$hash | \ xz >../$(pkg_name)-$$version.$(suffix) ) ; \ fi ; \ done $(sha1s): %.$(suffix).sha1sum : %.$(suffix) @for tarball in $< ; do \ echo -e "\n======= Calculation the '$$tarball' sha1sum =======" ; \ sha1sum --binary $$tarball > $$tarball.sha1sum ; \ done repository_clean: $(sha1s) @echo -e "\n======= Remove cloned $(repo_name).git repository =======\n" @rm -rf $(git_repo) $(repo_name) downloads_clean: @rm -rf $(tarballs) $(sha1s) @rm -rf $(git_repo) $(repo_name)