changeset 227: |
94227525d5ce |
parent: |
ee3bce140f7e
|
child: |
989b1b4782dc |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 24 May 2024 20:01:52 +0000 |
permissions: |
-rw-r--r-- |
description: |
move containers |
1 ### infra/makefile --- The Compiler Company Infrastructure 3 # this makefile is used to build all of our source code, package it, 4 # and ship it to various locations. It is for internal-use only. 6 # If possible, use the packy (packy.compiler.company) to find and 7 # download a prepared bundle that suits your project needs. 9 # You probably don't want to install all targets unless you have lots 10 # of time and a powerful machine, although it is possible. Instead, 11 # just run the targets for the components you are missing in your 12 # local environment (compatible compiler versions, shared libraries, 16 LINUX_VERSION:=$(shell
uname
-r
| cut
-d-
-f1
) 20 CONTAINERS:=containers
21 HG_COMMIT:=$(shell
hg
id
-i
) 22 DESTINATION:=/mnt/y/data/packy
23 # requires emacs-build-minimal 24 # artifacts can deploy to dist/TARGET - need target triple first 25 # init:sbcl rust emacs rocksdb code 26 # dist/linux dist/rust dist/bundle 27 archlinux:$(CONTAINERS)/
Containerfile.
archlinux;
podman build -
f $< -
t archlinux 28 box:$(CONTAINERS)/
Containerfile.
box archlinux;
podman build -
f $< -
t box 29 alpine:$(CONTAINERS)/
Containerfile.
alpine;
podman build -
f $< -
t alpine 30 ubuntu:$(CONTAINERS)/
Containerfile.
ubuntu;
podman build -
f $< -
t ubuntu 31 worker:$(CONTAINERS)/
Containerfile.
worker alpine;
podman build -
f $< -
t worker 32 operator:$(CONTAINERS)/
Containerfile.
operator box;
podman build -
f $< -
t operator 33 pods:archlinux alpine ubuntu box worker operator 35 all:dist/
code dist/
lisp dist/
rust dist/
sbcl dist/
rocksdb dist/
emacs dist/
pods 36 clean:;
rm -
rf $(B) $(D) 37 $(B):;
mkdir -
pv $@/
src 38 $(D):;
mkdir -
pv $@/
bin $@/
lib $@/
include $@/
bundle $@/
share 39 $(DESTINATION):$(D);
cd $< &&
cp -
rf ./* $@
41 LINUX_TARGET:=linux-
$(LINUX_VERSION
) 42 linux:$(LINUX_TARGET) linux-
config;
43 $(LINUX_TARGET):scripts/
get-
linux.
sh;
45 gpg
--export
autosigner@
torvalds@
gregkh@
>
build/
$@/keyring.gpg
46 $<
$(LINUX_VERSION
) build
build/
$@/keyring.gpg
47 cd build
&& unxz
$@.tar.xz
&& tar
-xvf
$@.tar
$(LINUX_TARGET
) 48 linux-config:$(LINUX_TARGET);
49 cd build/$<
&& make
mrproper
-j
&& zcat
/proc/config.gz
>
.config
&& yes
N
| make
localmodconfig
50 clean-linux::;
rm -
rf build/
$(LINUX_TARGET) 53 EMACS_TARGET:=build/src/emacs
54 EMACS_DIST:=$(D
)/src/emacs
55 $(EMACS_TARGET):scripts/
get-
emacs.
sh $(B);
58 emacs-build:scripts/
build-
emacs.
sh $(EMACS_TARGET) 59 cd $(EMACS_TARGET
) && ./autogen.sh
61 emacs-build-mini:scripts/
build-
emacs-
mini.
sh emacs 62 cd $(EMACS_TARGET
) && ./autogen.sh
64 emacs-install:$(EMACS_TARGET);
68 ROCKSDB_TARGET:=build/src/rocksdb
69 $(ROCKSDB_TARGET):scripts/
get-
rocksdb.
sh $(B) 71 rocksdb:$(ROCKSDB_TARGET) 73 rocksdb-build-shared:$(ROCKSDB_TARGET) 74 cd $<
&& make
shared_lib
DISABLE_JEMALLOC=1 76 rocksdb-build-static:$(ROCKSDB_TARGET) 77 cd $<
&& make
static_lib
DISABLE_JEMALLOC=1 79 rocksdb-install:$(ROCKSDB_TARGET) 80 cd $<
&& make
install
LIB_MODE=shared
&& cp
-r
include/*
/usr/local/include/
83 NUSHELL_TARGET:=build/src/nushell
84 $(NUSHELL_TARGET):scripts/
get-
nushell.
sh;$<
85 nushell:$(NUSHELL_TARGET) 86 # build without clipboard to avoid errors at runtime in container env 87 nushell-build:$(NUSHELL_TARGET) 88 cd $<
&& cargo
build
--workspace
--release
--no-default-features
--features
=default-no-clipboard,dataframe,extra
--locked
89 nushell-install:$(NUSHELL_TARGET) nushell-
build 90 cd $<
&& ./scripts/install-all.sh
92 SBCL_TARGET:=build/src/sbcl
94 $(SBCL_TARGET):scripts/
get-
sbcl.
sh $(B) 96 cd $(SBCL_TARGET
) && \ 97 echo '"$(SBCL_VERSION)"' >
version.lisp-expr
99 #### --with-sb-fasteval --without-sb-eval < broken 100 sbcl-build:$(SBCL_TARGET) 104 --with-mark-region-gc
\ 105 --dynamic-space-size
=8Gb
\ 107 sbcl-build-shared:$(SBCL_TARGET) sbcl-
build 109 ./make-shared-library.sh
110 sbcl-build-gencgc:$(SBCL_TARGET) 113 --dynamic-space-size
=8Gb
\ 115 sbcl-docs:sbcl-
build;
## REQUIRES TEXLIVE 116 cd $(SBCL_TARGET
)/doc/manual
&& make
117 sbcl-install:sbcl-
build;
cd $(SBCL_TARGET) &&
INSTALL_ROOT=/
usr/
local sh install.
sh 118 clean-sbcl:$(SBCL_TARGET);
cd $(SBCL_TARGET) && ./
clean.
sh 120 build/quicklisp.lisp:$(B);
cd $< &&
curl -
O https://
beta.
quicklisp.
org/
quicklisp.
lisp 121 quicklisp-install:scripts/
quicklisp-
install.
sh build/
quicklisp.
lisp;$<
123 STUMPWM_TARGET:=build/src/stumpwm
124 $(STUMPWM_TARGET):scripts/
get-
stumpwm.
sh $(B);$<
125 stumpwm:$(STUMPWM_TARGET);
126 stumpwm-build:stumpwm;
127 cd $(STUMPWM_TARGET
) && ./autogen.sh
&& ./configure
&& make
128 stumpwm-install:stumpwm-
build;
129 cd $(STUMPWM_TARGET
) && make
install
131 RUST_TARGET:=build/src/rust
132 $(RUST_TARGET):scripts/
get-
rust.
sh $(B);$<
135 cargo
install
--path
$(RUST_TARGET
)/src/tools/x
136 rust-build:rust rust-
install-
x;
137 cd $(RUST_TARGET
) && x
build
library
138 rust-doc:rust rust-
install-
x;
139 cd $(RUST_TARGET
) && x
doc
140 rust-build-full:rust-
build;
141 cd $(RUST_TARGET
) && x
build
--stage
2 compiler/rustc
142 rust-install:rust-
build;
143 cd $(RUST_TARGET
) && x
install
144 rustup-install:;
curl --
proto '=
https' --
tlsv1.2 -
sSf https://
sh.
rustup.
rs | sh -
s -- -
y 145 cargo-tools-install:scripts/
install-
cargo-
tools.
sh 148 TREE_SITTER_TARGET:=build/src/tree-sitter
149 $(TREE_SITTER_TARGET):scripts/
get-
tree-
sitter.
sh 151 tree-sitter:$(TREE_SITTER_TARGET) 152 tree-sitter-build:$(TREE_SITTER_TARGET) 153 tree-sitter-install:$(TREE_SITTER_TARGET) tree-
sitter-
build 155 ### Tree-sitter Langs 156 TREE_SITTER_LANGS_TARGET:=build/src/tree-sitter-langs
157 tree-sitter-langs-install:scripts/
tree-
sitter-
install-
langs.
sh 160 ETC_TARGET:=build/etc
161 $(ETC_TARGET):scripts/
get-
etc.
sh 166 CODE_TARGET:=build/src/
$(SRC
) 167 $(CODE_TARGET):scripts/
get-
code.
sh $(B) 170 clean-code::;
rm -
rf $(CODE_TARGET) 173 dist/bundle:scripts/
bundle-
code.
sh $(CODE_TARGET) 178 scripts/dist-sbcl-binary.sh
$(SBCL_TARGET
) $(D
) 179 cd $(SBCL_TARGET
) && sh
./clean.sh
180 scripts/dist-sbcl-source.sh
$(SBCL_TARGET
) $(D
) 182 dist/linux:linux $(D);
184 dist/rocksdb:$(D) rocksdb;
186 tar
-I
'zstd' -cf
../../$</rocksdb.tar.zst
rocksdb/include/*
rocksdb/librocksdb.*
188 CORE_SRC?=/usr/local/src/core
190 dist/rust:rust-
build $(D);
191 cd $(RUST_TARGET
) && x
dist
193 dist/rust/bin:scripts/
cargo-
install.
sh 195 $<
"$(CORE_SRC
)/rust/app/cli/alik" dist/rust
196 $<
"$(CORE_SRC
)/rust/app/cli/krypt" dist/rust
197 $<
"$(CORE_SRC
)/rust/app/cli/tz" dist/rust
198 $<
"$(CORE_SRC
)/rust/app/cli/cc-install" dist/rust
199 $<
"$(CORE_SRC
)/rust/app/cli/mailman" dist/rust
201 dist/emacs:emacs-
build $(D);
202 cd $(EMACS_TARGET
) && ./make-dist
--no-info
--no-changelog
&& \ 203 mv
emacs-*.*.*
emacs
&& \ 204 tar
-I
'zstd' -cf
../../../dist/emacs-binary.tar.zst
emacs
206 dist/emacs-mini:emacs-
build-
mini $(D);
207 cd $(EMACS_TARGET
) && ./make-dist
--no-info
--no-changelog
&& \ 208 mv
emacs-*.*.*
emacs
&& \ 209 tar
-I
'zstd' -cf
../../../dist/emacs-mini-binary.tar.zst
emacs
211 dist/nushell:$(D) nushell-
build 212 cd $(NUSHELL_TARGET
)/target/release/
&& \ 213 tar
-I
'zstd' -cf
../../../../../$</nushell.tar.zst
\ 214 nu
nu_plugin_custom_values
nu_plugin_formats
nu_plugin_gstat
\ 215 nu_plugin_inc
nu_plugin_query
217 dist/tree-sitter:scripts/
tree-
sitter-
install-
langs.
sh $(D) 220 # requires quicklisp loaded in .skelrc 221 dist/lisp/fasl:scripts/
sbcl-
save-
core.
sh 224 $<
"$@/prelude.core" "(mapc #'ql:quickload \ 225 (list :nlp :rdb :organ :packy :skel :obj :net :parse :pod :dat :log :packy :rt :syn :xdb :doc :vc))" 227 dist/lisp/bin:scripts/
sbcl-
make-
bin.
sh 230 mv
$(CORE_SRC
)/lisp/app/bin/skel
$@ 231 rm
-f
$(CORE_SRC
)/lisp/app/bin/skel.fasl
233 cp
$(CORE_SRC
)/lisp/app/bin/organ
$@ 234 rm
-f
$(CORE_SRC
)/lisp/app/bin/organ.fasl
236 cp
$(CORE_SRC
)/lisp/app/bin/homer
$@ 237 rm
-f
$(CORE_SRC
)/lisp/app/bin/homer.fasl
239 cp
$(CORE_SRC
)/lisp/app/bin/packy
$@ 240 rm
-f
$(CORE_SRC
)/lisp/app/bin/packy.fasl
242 cp
$(CORE_SRC
)/lisp/app/bin/rdb
$@ 243 rm
-f
$(CORE_SRC
)/lisp/app/bin/rdb.fasl
245 dist/lisp:dist/
lisp/
fasl dist/
lisp/
bin 247 core-lisp-install:dist/
lisp 248 install
-m
755 $</bin/*
/usr/local/bin/
249 install
-m
755 $</fasl/*
/usr/local/lib/sbcl/
251 core-rust-install:dist/
rust/
bin 252 install
-m
755 $</*
/usr/local/bin/
254 core-install:core-
lisp-
install core-
rust-
install 256 dist/core:dist/
rust/
bin dist/
lisp 258 cp
-rf
$(D
)/lisp/fasl
$(D
)/lisp/bin
$(D
)/core
260 cd $(D
) && tar
-I
'zstd' -cf
core.tar.zst
core
264 dist/etc:$(ETC_TARGET) 265 cd $(ETC_TARGET
) && hg
up
$(ETC
) 266 cp
-rf
$(ETC_TARGET
) $(D
)/etc
270 cp
-r
$(CODE_TARGET
)/
{org,core,infra,demo,etc
} $@ 273 podman
image
save
-o
$@/all.tar
archlinux
alpine
ubuntu
box
worker
operator
274 cd $@ && zstd
--ultra
-T4
--rm
all.tar
-o
all.tar.zst
275 clean-dist:;
rm -
rf $(D) 276 clean-build:;
rm -
rf $(B)