Skip to content

Commit

Permalink
edit Makefile (change order)
Browse files Browse the repository at this point in the history
  • Loading branch information
snmsts committed Sep 11, 2024
1 parent 194887b commit d9469bf
Showing 1 changed file with 29 additions and 14 deletions.
43 changes: 29 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,52 @@
-include .env
export $(shell sed 's/=.*//' .env)

VERSION=`date +%y.%-m.%-d`
LAST_VERSION=`ros web.ros version`
VERSION ?= $(shell date +%y.%-m.%-d)
ORIGIN_URI=https://github.com/sbcl/sbcl
ORIGIN_REF=master
GITHUB=https://github.com/roswell/sbcl_head
TSV_FILE=sbcl-bin_uri.tsv
TSV_FILE ?= sbcl-bin_uri.tsv

LAST_VERSION=$(shell ros web.ros version)
WEB_ROS_URI=https://raw.githubusercontent.com/roswell/sbcl_bin/master/web.ros

clean:
rm -f hash lasthash

#version
version: web.ros
@echo $(LAST_VERSION) > $@
branch: version
$(eval VERSION := $(shell cat version))
VERSION=$(VERSION) ros build.ros branch > $@
latest-uris: web.ros
ros web.ros latests
web.ros:
curl -L -O $(WEB_ROS_URI)
#tag
hash:
git ls-remote --heads $(ORIGIN_URI) $(ORIGIN_REF) |sed -r "s/^([0-9a-fA-F]*).*/\1/" > hash

lasthash: web.ros
curl -sSL -o lasthash $(GITHUB)/releases/download/$(LAST_VERSION)/hash
curl -sSL -o lasthash $(GITHUB)/releases/download/files/hash || touch lasthash

tag: hash web.ros
($(MAKE) lasthash && diff -u hash lasthash) || \
( VERSION=$(VERSION) ros web.ros upload-hash; \
VERSION=$(VERSION) ros web.ros upload-hash; \
VERSION=files ros web.ros upload-hash)

#tsv
tsv: web.ros
TSV_FILE=$(TSV_FILE) ros web.ros tsv

upload-tsv: web.ros
TSV_FILE=$(TSV_FILE) ros web.ros upload-tsv

version: web.ros
@echo $(LAST_VERSION) > version
web.ros:
curl -L -O https://raw.githubusercontent.com/roswell/sbcl_bin/master/web.ros

clean:
rm -f hash lasthash

table:
download-tsv: web.ros
VERSION=$(VERSION) ros web.ros get-tsv
#table
table: web.ros
ros web.ros table
#archive
upload-archive: web.ros
VERSION=$(VERSION) TARGET=$(ARCH) SUFFIX=$(SUFFIX) ros web.ros upload-archive

0 comments on commit d9469bf

Please sign in to comment.