-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
170 lines (138 loc) · 5.02 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
-include .env
export $(shell sed 's/=.*//' .env)
VERSION ?= $(shell date +%y.%-m.%-d)
ORIGIN_URI=https://github.com/roswell/clisp
ORIGIN_REF=master
GITHUB=https://github.com/roswell/clisp_head
TSV_FILE ?= clisp-bin_uri.tsv
SIGSEGV_VERSION ?= 2.14
FFCALL_VERSION ?= 2.5
RELEASE_DATE ?= $(shell date +%F)
OS ?= $(shell ros roswell-internal-use uname)
CPU ?= $(shell ros roswell-internal-use uname -m)
VARIANT ?=
CLISP_LDFLAGS ?=
DOCKER_REPO ?= docker.pkg.github.com/roswell/clisp_bin
DOCKER_PLATFORM ?= linux/amd64
DOCKER_ACTION ?= docker-default-action
PACK=clisp-$(VERSION)-$(CPU)-$(OS)$(VARIANT)
LAST_VERSION=$(shell ros web.ros version)
hash:
git ls-remote --heads $(ORIGIN_URI) $(ORIGIN_REF) |sed -E "s/^([0-9a-fA-F]*).*/\1/" > hash
lasthash: web.ros
curl -sfSL -o lasthash $(GITHUB)/releases/download/files/hash || touch lasthash
latest-version: lasthash version
$(eval VERSION := $(shell cat version))
$(eval HASH := $(shell cat lasthash))
@echo "set version $(VERSION):$(HASH)"
download: lasthash libsigsegv-$(SIGSEGV_VERSION).tar.gz libffcall-$(FFCALL_VERSION).tar.gz
tag: hash lasthash web.ros
@echo hash = $(shell cat hash)
@echo lasthash = $(shell cat lasthash)
touch $(shell cat hash)
diff -u hash lasthash || \
( VERSION=$(VERSION) FILE=hash ros web.ros upload-archive; \
VERSION=$(VERSION) FILE=$(shell cat hash) ros web.ros upload-archive; \
VERSION=$(VERSION) FILE=hash ros web.ros upload-archive; \
VERSION=$(VERSION) FILE=$(shell cat hash) ros web.ros upload-archive; \
VERSION=files FILE=hash ros web.ros upload-archive)
tsv: web.ros
TSV_FILE=$(TSV_FILE) ros web.ros tsv
upload-tsv: web.ros
TSV_FILE=$(TSV_FILE) VERSION=$(VERSION) ros web.ros upload-tsv
download-tsv:
TSV_FILE=$(TSV_FILE) VERSION=$(VERSION) ros web.ros get-tsv
version: web.ros
@echo $(LAST_VERSION) > version
web.ros:
curl -L -O https://raw.githubusercontent.com/roswell/sbcl_bin/master/web.ros
show:
@echo PACK=$(PACK) CC=$(CC)
libsigsegv-$(SIGSEGV_VERSION).tar.gz:
curl -O https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-$(SIGSEGV_VERSION).tar.gz
sigsegv: libsigsegv-$(SIGSEGV_VERSION).tar.gz
tar xfz libsigsegv-$(SIGSEGV_VERSION).tar.gz
cd libsigsegv-$(SIGSEGV_VERSION);CC='$(CC)' ./configure --prefix=`pwd`/../sigsegv;make;make check;make install
rm -rf libsigsegv-$(SIGSEGV_VERSION)
libffcall-$(FFCALL_VERSION).tar.gz:
curl -O https://ftp.gnu.org/gnu/libffcall/libffcall-$(FFCALL_VERSION).tar.gz
ffcall: libffcall-$(FFCALL_VERSION).tar.gz
tar xfz libffcall-$(FFCALL_VERSION).tar.gz
cd libffcall-$(FFCALL_VERSION);CC='$(CC)' ./configure --prefix=`pwd`/../ffcall --disable-shared;make;make check;make install
rm -rf libffcall-$(FFCALL_VERSION)
clisp: download lasthash
git clone --depth 100 $(ORIGIN_URI) || true
cd clisp;git checkout `cat ../lasthash`
cd clisp; \
git init; \
git remote add origin $(ORIGIN_URI); \
git fetch --depth=1 origin $(shell cat lasthash); \
git reset --hard FETCH_HEAD
clisp/version.sh: clisp
echo VERSION_NUMBER=$(VERSION) > clisp/version.sh
echo RELEASE_DATE=$(RELEASE_DATE) >> clisp/version.sh
cd clisp/src; \
autoconf; \
autoheader
compile: show sigsegv ffcall clisp
rm -f clisp/version.sh; $(MAKE) clisp/version.sh
cd clisp; \
CC='$(CC)' \
LDFLAGS='$(CLISP_LDFLAGS)' \
FORCE_UNSAFE_CONFIGURE=1 \
./configure \
--with-libsigsegv-prefix=`pwd`/../sigsegv \
--with-libffcall-prefix=`pwd`/../ffcall \
--prefix=`pwd`/../$(PACK)
cd clisp/src; \
make; \
make install
archive: show
tar cjvf $(PACK)-binary.tar.bz2 $(PACK)
bash -c "cd clisp/src;make distrib;mv clisp-*.gz ../.."
mv clisp-*.gz $(PACK)-distribute.tar.gz
upload-archive-p:
curl -I -f https://github.com/roswell/clisp_head/releases/download/$(VERSION)/$(PACK)-binary.tar.bz2 > /dev/null
upload-archive: show
VERSION=$(VERSION) TARGET=$(ARCH) SUFFIX=$(SUFFIX) ros web.ros upload-archive
debug-docker:
docker run \
--rm \
-it \
--platform $(DOCKER_PLATFORM) \
-v `pwd`:/tmp \
$(DOCKER_REPO)/$$(cat ./tools-for-build/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX) \
bash
build-docker:
docker build --platform $(DOCKER_PLATFORM) -t $(DOCKER_REPO)/$$(cat ./tools-for-build/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX) $(DOCKER_BUILD_OPTIONS) ./tools-for-build/$(IMAGE)
push-docker:
docker push $(DOCKER_REPO)/$$(cat ./tools-for-build/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX);
pull-docker:
docker pull $(DOCKER_REPO)/$$(cat ./tools-for-build/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX);
pull-docker-old:
docker pull $(DOCKER_REPO)/$(IMAGE);
docker:
docker run \
--rm \
--platform $(DOCKER_PLATFORM) \
-v `pwd`:/tmp \
-e VERSION=$(VERSION) \
-e CPU=$(CPU) \
-e OS=$(OS) \
-e CC='$(CC)' \
-e CLISP_LDFLAGS='$(CLISP_LDFLAGS)' \
-e VARIANT=$(VARIANT) \
-e CFLAGS=$(CFLAGS) \
-e LINKFLAGS=$(LINKFLAGS) \
$(DOCKER_REPO)/$$(cat ./tools-for-build/$(IMAGE)/Name)$(DOCKER_IMAGE_SUFFIX) \
bash \
-c "cd /tmp;bash ./tools-for-build/$(IMAGE)/setup;make $(DOCKER_ACTION)"
docker-default-action: compile archive
clean:
rm -rf sigsegv ffcall clisp
rm -f lib*.gz
rm -rf $(PACK)
rm -f hash lasthash version
#rm -f clisp*.tar.bz2
table: web.ros
ros web.ros table