changeset 214: |
847281f20daf |
parent: |
d558bc40ee9a
|
child: |
91cb7ffc5945 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Mon, 29 Apr 2024 00:27:10 +0000 |
permissions: |
-rw-r--r-- |
description: |
easy-rsa |
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 HG_COMMIT:=$(shell
hg
id
-i
) 21 DESTINATION:=/mnt/y/data/packy
22 # requires emacs-build-minimal 23 # artifacts can deploy to dist/TARGET - need target triple first 24 # init:sbcl rust emacs rocksdb code 25 # dist/linux dist/rust dist/bundle 26 archlinux:Containerfile.
archlinux;
podman build -
f $< -
t archlinux 27 box:Containerfile.
box archlinux;
podman build -
f $< -
t box 28 alpine:Containerfile.
alpine;
podman build -
f $< -
t alpine 29 ubuntu:Containerfile.
ubuntu;
podman build -
f $< -
t ubuntu 30 vc:Containerfile.
vc ubuntu;
podman build -
f $< -
t vc 31 vc-runner:Containerfile.
vc-
runner ubuntu;
podman build -
f $< -
t vc-
runner 32 worker:Containerfile.
worker alpine;
podman build -
f $< -
t worker 33 operator:Containerfile.
operator box;
podman build -
f $< -
t operator 34 pods:archlinux alpine ubuntu box worker operator vc # vc-runner ## requires token 36 all:dist/
cdn dist/
code dist/
lisp dist/
rust dist/
sbcl dist/
rocksdb dist/
emacs dist/
pods 37 clean:;
rm -
rf $(B) $(D) 38 $(B):;
mkdir -
pv $@/
src 39 $(D):;
mkdir -
pv $@/
bin $@/
lib $@/
include $@/
bundle $@/
share 40 $(DESTINATION):$(D);
cd $< &&
cp -
rf ./* $@
42 LINUX_TARGET:=linux-
$(LINUX_VERSION
) 43 linux:$(LINUX_TARGET) linux-
config;
45 $(LINUX_TARGET):scripts/
get-
linux.
sh;
47 gpg
--export
autosigner@
torvalds@
gregkh@
>
build/
$@/keyring.gpg
48 $<
$(LINUX_VERSION
) build
build/
$@/keyring.gpg
49 cd build
&& unxz
$@.tar.xz
&& tar
-xvf
$@.tar
$(LINUX_TARGET
) 50 linux-config:$(LINUX_TARGET);
51 cd build/$<
&& make
mrproper
-j
&& zcat
/proc/config.gz
>
.config
&& yes
N
| make
localmodconfig
52 clean-linux::;
rm -
rf build/
$(LINUX_TARGET) 55 EMACS_TARGET:=build/src/emacs
56 EMACS_DIST:=$(D
)/src/emacs
57 $(EMACS_TARGET):scripts/
get-
emacs.
sh $(B);
60 emacs-build:scripts/
build-
emacs.
sh $(EMACS_TARGET) 61 cd $(EMACS_TARGET
) && ./autogen.sh
63 emacs-build-mini:scripts/
build-
emacs-
mini.
sh emacs 64 cd $(EMACS_TARGET
) && ./autogen.sh
66 emacs-install:$(EMACS_TARGET);
70 ROCKSDB_TARGET:=build/src/rocksdb
71 $(ROCKSDB_TARGET):scripts/
get-
rocksdb.
sh $(B) 73 rocksdb:$(ROCKSDB_TARGET) 75 rocksdb-build-shared:$(ROCKSDB_TARGET) 76 cd $<
&& make
shared_lib
DISABLE_JEMALLOC=1 78 rocksdb-build-static:$(ROCKSDB_TARGET) 79 cd $<
&& make
static_lib
DISABLE_JEMALLOC=1 81 rocksdb-install:$(ROCKSDB_TARGET) 82 cd $<
&& make
install
LIB_MODE=shared
&& cp
-r
include/*
/usr/local/include/
85 NUSHELL_TARGET:=build/src/nushell
86 $(NUSHELL_TARGET):scripts/
get-
nushell.
sh;$<
87 nushell:$(NUSHELL_TARGET) 88 # build without clipboard to avoid errors at runtime in container env 89 nushell-build:$(NUSHELL_TARGET) 90 cd $<
&& cargo
build
--workspace
--release
--no-default-features
--features
=default-no-clipboard,dataframe,extra
--locked
91 nushell-install:$(NUSHELL_TARGET) nushell-
build 92 cd $<
&& ./scripts/install-all.sh
94 SBCL_TARGET:=build/src/sbcl
96 $(SBCL_TARGET):scripts/
get-
sbcl.
sh $(B) 98 cd $(SBCL_TARGET
) && \ 99 echo '"$(SBCL_VERSION)"' >
version.lisp-expr
101 #### --with-sb-fasteval --without-sb-eval < broken 102 sbcl-build:$(SBCL_TARGET) 106 --with-mark-region-gc
\ 107 --dynamic-space-size
=8Gb
\ 109 sbcl-build-shared:$(SBCL_TARGET) sbcl-
build 111 ./make-shared-library.sh
112 sbcl-build-gencgc:$(SBCL_TARGET) 115 --dynamic-space-size
=8Gb
\ 117 sbcl-docs:sbcl-
build;
## REQUIRES TEXLIVE 118 cd $(SBCL_TARGET
)/doc/manual
&& make
119 sbcl-install:sbcl-
build;
cd $(SBCL_TARGET) &&
INSTALL_ROOT=/
usr/
local sh install.
sh 120 clean-sbcl:$(SBCL_TARGET);
cd $(SBCL_TARGET) && ./
clean.
sh 122 build/quicklisp.lisp:$(B);
cd $< &&
curl -
O https://
beta.
quicklisp.
org/
quicklisp.
lisp 123 quicklisp-install:scripts/
quicklisp-
install.
sh build/
quicklisp.
lisp;$<
124 STUMPWM_TARGET:=build/src/stumpwm
126 $(STUMPWM_TARGET):scripts/
get-
stumpwm.
sh $(B);$<
127 stumpwm:$(STUMPWM_TARGET);
128 stumpwm-build:stumpwm;
129 cd $(STUMPWM_TARGET
) && ./autogen.sh
&& ./configure
&& make
130 stumpwm-install:stumpwm-
build;
131 cd $(STUMPWM_TARGET
) && make
install
133 RUST_TARGET:=build/src/rust
134 $(RUST_TARGET):scripts/
get-
rust.
sh $(B);$<
137 cargo
install
--path
$(RUST_TARGET
)/src/tools/x
138 rust-build:rust rust-
install-
x;
139 cd $(RUST_TARGET
) && x
build
library
140 rust-doc:rust rust-
install-
x;
141 cd $(RUST_TARGET
) && x
doc
142 rust-build-full:rust-
build;
143 cd $(RUST_TARGET
) && x
build
--stage
2 compiler/rustc
144 rust-install:rust-
build;
145 cd $(RUST_TARGET
) && x
install
146 rustup-install:;
curl --
proto '=
https' --
tlsv1.2 -
sSf https://
sh.
rustup.
rs | sh -
s -- -
y 147 cargo-tools-install:scripts/
install-
cargo-
tools.
sh 150 TREE_SITTER_TARGET:=build/src/tree-sitter
151 $(TREE_SITTER_TARGET):scripts/
get-
tree-
sitter.
sh 153 tree-sitter:$(TREE_SITTER_TARGET) 154 tree-sitter-build:$(TREE_SITTER_TARGET) 156 tree-sitter-install:$(TREE_SITTER_TARGET) tree-
sitter-
build 157 cd $<
&& make
install
&& cp
-r
lib/include/*
/usr/local/include/
158 ### Tree-sitter Langs 159 TREE_SITTER_LANGS_TARGET:=build/src/tree-sitter-langs
160 tree-sitter-langs-install:scripts/
tree-
sitter-
install-
langs.
sh 163 CODE_TARGET:=build/src/
$(SRC
) 164 $(CODE_TARGET):scripts/
get-
code.
sh $(B) 167 clean-code::;
rm -
rf $(CODE_TARGET) 170 dist/bundle:scripts/
bundle-
code.
sh $(CODE_TARGET) 179 scripts/dist-sbcl-binary.sh
$(SBCL_TARGET
) $(D
) 180 cd $(SBCL_TARGET
) && sh
./clean.sh
181 scripts/dist-sbcl-source.sh
$(SBCL_TARGET
) $(D
) 183 dist/linux:linux $(D);
185 dist/rocksdb:$(D) rocksdb;
187 tar
-I
'zstd' -cf
../../$</rocksdb.tar.zst
rocksdb/include/*
rocksdb/librocksdb.*
189 CORE_SRC?=/usr/local/src/core
191 dist/rust:rust-
build $(D);
192 cd $(RUST_TARGET
) && x
dist
194 dist/rust/bin:scripts/
cargo-
install.
sh 196 $<
"$(CORE_SRC
)/rust/app/cli/alik" dist/rust
197 $<
"$(CORE_SRC
)/rust/app/cli/krypt" dist/rust
198 $<
"$(CORE_SRC
)/rust/app/cli/tz" dist/rust
199 $<
"$(CORE_SRC
)/rust/app/cli/cc-install" dist/rust
200 $<
"$(CORE_SRC
)/rust/app/cli/mailman" dist/rust
202 dist/emacs:emacs-
build $(D);
203 cd $(EMACS_TARGET
) && ./make-dist
--no-info
--no-changelog
&& \ 204 mv
emacs-*.*.*
emacs
&& \ 205 tar
-I
'zstd' -cf
../../../dist/emacs-binary.tar.zst
emacs
207 dist/emacs-mini:emacs-
build-
mini $(D);
208 cd $(EMACS_TARGET
) && ./make-dist
--no-info
--no-changelog
&& \ 209 mv
emacs-*.*.*
emacs
&& \ 210 tar
-I
'zstd' -cf
../../../dist/emacs-mini-binary.tar.zst
emacs
212 dist/nushell:$(D) nushell-
build 213 cd $(NUSHELL_TARGET
)/target/release/
&& \ 214 tar
-I
'zstd' -cf
../../../../../$</nushell.tar.zst
\ 215 nu
nu_plugin_custom_values
nu_plugin_formats
nu_plugin_gstat
\ 216 nu_plugin_inc
nu_plugin_query
218 dist/tree-sitter:scripts/
tree-
sitter-
install-
langs.
sh $(D) 221 # requires quicklisp loaded in .skelrc 222 dist/lisp/fasl:scripts/
sbcl-
save-
core.
sh 225 $<
"$@/prelude.core" "(mapc #'ql:quickload \ 226 (list :nlp :rdb :organ :packy :skel :obj :net :parse :pod :dat :log :packy :rt :syn :xdb :doc :vc))" 228 dist/lisp/bin:scripts/
sbcl-
make-
bin.
sh 231 mv
$(CORE_SRC
)/lisp/app/bin/skel
$@ 232 rm
-f
$(CORE_SRC
)/lisp/app/bin/skel.fasl
234 cp
$(CORE_SRC
)/lisp/app/bin/organ
$@ 235 rm
-f
$(CORE_SRC
)/lisp/app/bin/organ.fasl
237 cp
$(CORE_SRC
)/lisp/app/bin/homer
$@ 238 rm
-f
$(CORE_SRC
)/lisp/app/bin/homer.fasl
240 cp
$(CORE_SRC
)/lisp/app/bin/packy
$@ 241 rm
-f
$(CORE_SRC
)/lisp/app/bin/packy.fasl
243 cp
$(CORE_SRC
)/lisp/app/bin/rdb
$@ 244 rm
-f
$(CORE_SRC
)/lisp/app/bin/rdb.fasl
246 dist/lisp:dist/
lisp/
fasl dist/
lisp/
bin 248 core-lisp-install:dist/
lisp 249 install
-m
755 $</bin/*
/usr/local/bin/
250 install
-m
755 $</fasl/*
/usr/local/lib/sbcl/
252 core-rust-install:dist/
rust/
bin 253 install
-m
755 $</*
/usr/local/bin/
255 core-install:core-
lisp-
install core-
rust-
install 257 dist/core:dist/
rust/
bin dist/
lisp 259 cp
-rf
dist/lisp/fasl
dist/lisp/bin
$@ 261 cd dist
&& tar
-I
'zstd' -cf
core.tar.zst
core
264 cp
-r
$(CODE_TARGET
)/
{org,core,infra,demo
} $@ 267 podman
image
save
-o
$(D
)/pods/all.tar
archlinux
alpine
ubuntu
box
worker
operator
vv
268 cd $(D
)/pods
&& zstd
--ultra
-T8
--rm
all.tar
-o
all.tar.zst
269 clean-dist:;
rm -
rf dist 270 clean-build:;
rm -
rf $(B)