changeset 65: |
541d8f57bc25 |
parent: |
8567ae279270
|
child: |
cbd11dc24d4d |
author: |
ellis <ellis@rwest.io> |
date: |
Wed, 03 Jan 2024 21:30:04 -0500 |
permissions: |
-rw-r--r-- |
description: |
makefile fix |
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 worker:rocksdb-
install sbcl-
install ts-
langs-
install quicklisp-
install comp 24 # artifacts can deploy to dist/TARGET - need target triple first 25 # init:sbcl rust emacs rocksdb comp virt; 26 # dist/linux dist/rust dist/bundle 27 all:dist/
cdn dist/
comp dist/
lisp dist/
rust dist/
sbcl dist/
rocksdb dist/
emacs 28 clean:;
rm -
rf $(B) $(D) 29 $(B):;
mkdir -
pv $@/
src 31 $(DESTINATION):$(D);
cd $< &&
cp -
rf ./* $@
34 LINUX_TARGET:=linux-
$(LINUX_VERSION
) 35 linux:$(LINUX_TARGET) linux-
config;
37 $(LINUX_TARGET):scripts/
get-
linux.
sh;
39 gpg
--export
autosigner@
torvalds@
gregkh@
>
build/
$@/keyring.gpg
40 $<
$(LINUX_VERSION
) build
build/
$@/keyring.gpg
41 cd build
&& unxz
$@.tar.xz
&& tar
-xvf
$@.tar
$(LINUX_TARGET
) 42 linux-config:$(LINUX_TARGET);
43 cd build/$<
&& make
mrproper
-j
&& zcat
/proc/config.gz
>
.config
&& yes
N
| make
localmodconfig
44 clean-linux::;
rm -
rf build/
$(LINUX_TARGET) 47 EMACS_TARGET:=build/src/emacs
48 EMACS_DIST:=$(D
)/src/emacs
49 $(EMACS_TARGET):scripts/
get-
emacs.
sh $(B);
52 emacs-build:emacs scripts/
build-
emacs.
sh;
53 cd $(EMACS_TARGET
) && ./autogen.sh
54 scripts/build-emacs.sh
$(EMACS_TARGET
) 55 emacs-install:emacs-
build;
56 cd $(EMACS_TARGET
) && make
install
59 ROCKSDB_TARGET:=build/src/rocksdb
60 $(ROCKSDB_TARGET):scripts/
get-
rocksdb.
sh $(B) 62 cd $(ROCKSDB_TARGET
) && \ 63 make
shared_lib
DISABLE_JEMALLOC=1 64 rocksdb:$(ROCKSDB_TARGET) 66 rocksdb-install:$(ROCKSDB_TARGET) 67 cp
-rf
$(ROCKSDB_TARGET
)/include/*
/usr/local/include/
68 cp
-f
$(ROCKSDB_TARGET
)/librocksdb.*
/usr/local/lib/
70 # TODO: separate params 72 # --with-mark-region-gc \ 74 SBCL_TARGET:=build/src/sbcl
75 $(SBCL_TARGET):scripts/
get-
sbcl.
sh $(B);
77 cd $(SBCL_TARGET
) && \ 78 echo '"2.4.1+main"' >
version.lisp-expr
&& \ 80 --with-sb-xref-for-internals
\ 81 --with-core-compression
\ 82 --dynamic-space-size
=8Gb
\ 85 sbcl-docs:sbcl;
## REQUIRES TEXLIVE 86 cd $(SBCL_TARGET
)/doc/manual
&& make
87 sbcl-install:sbcl;
cd $(SBCL_TARGET) && ./
install.
sh 88 clean-sbcl:$(SBCL_TARGET);
cd $(SBCL_TARGET) && ./
clean.
sh 90 build/quicklisp.lisp:$(B);
cd $< &&
curl -
O https://
beta.
quicklisp.
org/
quicklisp.
lisp 91 quicklisp-install:scripts/
quicklisp-
install.
sh build/
quicklisp.
lisp;$<
94 RUST_TARGET:=build/src/rust
95 $(RUST_TARGET):scripts/
get-
rust.
sh $(B);$<
98 cargo
install
--path
$(RUST_TARGET
)/src/tools/x
99 rust-build:rust rust-
install-
x;
100 cd $(RUST_TARGET
) && x
build
library
101 rust-doc:rust rust-
install-
x;
102 cd $(RUST_TARGET
) && x
doc
103 rust-build-full:rust-
build;
104 cd $(RUST_TARGET
) && x
build
--stage
2 compiler/rustc
105 rust-install:rust-
build;
106 cd $(RUST_TARGET
) && x
install
108 ### Tree-sitter Langs 109 TS_LANGS_TARGET:=build/src/ts-langs
110 ts-langs-install:scripts/
ts-
install-
langs.
sh 113 COMP_TARGET:=build/src/
$(SRC
) 114 comp:scripts/
get-
comp.
sh $(B) 117 clean-comp::;
rm -
rf $(COMP_TARGET) 120 dev-pod:virt/
build-
pod.
sh 122 archlinux:virt/
build-
archlinux-
base.
sh 124 fedora:virt/
build-
fedora-
base.
sh 126 box:virt/
build-
box-
base.
sh 128 bbdb:virt/
build-
bbdb-
base.
sh 130 heptapod:virt/
build-
heptapod.
sh 132 heptapod-runner:virt/
build-
heptapod-
runner.
sh 135 vc-pod:heptapod heptapod-
runner 140 dist/bundle:scripts/
bundle-
dir.
sh comp 150 cp
$(SBCL_TARGET
)/src/runtime/sbcl
$@ 151 cp
$(SBCL_TARGET
)/output/sbcl.core
$@ 152 cp
-r
$(SBCL_TARGET
)/contrib
$@ 153 cd $(SBCL_TARGET
) && ./clean.sh
154 tar
-I
'zstd' -cf
$@/sbcl-source.tar.zst
--exclude
.git
$(SBCL_TARGET
) 156 dist/linux:linux $(D);
158 dist/rocksdb:rocksdb $(D);
160 cp
-rf
$(ROCKSDB_TARGET
)/include/*
$@ 161 cp
-f
$(ROCKSDB_TARGET
)/librocksdb.*
$@ 163 dist/rust:rust-
build $(D);
164 cd $(RUST_TARGET
) && x
dist
165 dist/rust/bin:scripts/
cargo-
install.
sh comp 167 $<
"$(COMP_TARGET
)/core/rust/app/cli/alik" "dist/rust" 168 $<
"$(COMP_TARGET
)/core/rust/app/cli/krypt" "dist/rust" 169 $<
"$(COMP_TARGET
)/core/rust/app/cli/tz" "dist/rust" 170 $<
"$(COMP_TARGET
)/core/rust/app/cli/cc-init" "dist/rust" 171 $<
"$(COMP_TARGET
)/core/rust/app/cli/mailman" "dist/rust" 173 dist/emacs:emacs-
build $(D);
175 # requires quicklisp loaded in .skelrc 176 dist/lisp/fasl:scripts/
sbcl-
save-
core.
sh # quicklisp-install 179 $<
"$@/prelude.core" "(mapc #'ql:quickload \ 180 (list :nlp :rdb :organ :packy :skel :obj :net :parse :pod :dat :log :packy :rt :syn :xdb :doc :vc :rt))" 182 dist/lisp/bin:scripts/
sbcl-
make-
bin.
sh comp 184 cp
$(COMP_TARGET
)/core/lisp/app/bin/skel
$@ 185 rm
-f
$(COMP_TARGET
)/core/lisp/app/bin/skel.fasl
187 cp
$(COMP_TARGET
)/core/lisp/app/bin/organ
$@ 188 rm
-f
$(COMP_TARGET
)/core/lisp/app/bin/organ.fasl
190 cp
$(COMP_TARGET
)/core/lisp/app/bin/homer
$@ 191 rm
-f
$(COMP_TARGET
)/core/lisp/app/bin/homer.fasl
193 cp
$(COMP_TARGET
)/core/lisp/app/bin/packy
$@ 194 rm
-f
$(COMP_TARGET
)/core/lisp/app/bin/packy.fasl
196 cp
$(COMP_TARGET
)/core/lisp/app/bin/rdb
$@ 197 rm
-f
$(COMP_TARGET
)/core/lisp/app/bin/rdb.fasl
201 cp
-r
$(COMP_TARGET
)/
{org,core,infra,demo,nas-t
} $@ 202 clean-dist:;
rm -
rf $(D) 203 clean-build:;
rm -
rf $(B)