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
) 24 HG_COMMIT:=$(shell
hg
id
-i
) 26 init:sbcl rust emacs rocksdb code virt;
27 dist:dist/
bundle dist/
cdn dist/
sbcl dist/
rocksdb # dist/linux dist/rust 28 clean:;
rm -
rf $(B) $(D) 29 $(B):;
mkdir -
pv $@/
src 32 LINUX_TARGET:=linux-
$(LINUX_VERSION
) 33 linux:$(LINUX_TARGET) linux-
config;
35 $(LINUX_TARGET):scripts/
get-
linux.
sh;
37 gpg
--export
autosigner@
torvalds@
gregkh@
>
build/
$@/keyring.gpg
38 $<
$(LINUX_VERSION
) build
build/
$@/keyring.gpg
39 cd build
&& unxz
$@.tar.xz
&& tar
-xvf
$@.tar
$(LINUX_TARGET
) 40 linux-config:$(LINUX_TARGET);
41 cd build/$<
&& make
mrproper
-j
&& zcat
/proc/config.gz
>
.config
&& yes
N
| make
localmodconfig
42 clean-linux::;
rm -
rf build/
$(LINUX_TARGET) 45 EMACS_TARGET:=build/src/emacs-
$(EMACS_VERSION
) 46 EMACS_DIST:=$(D
)/src/emacs
47 $(EMACS_TARGET):scripts/
get-
emacs.
sh $(B);
50 emacs-build:emacs scripts/
build-
emacs.
sh;
51 cd $(EMACS_TARGET
) && ./autogen.sh
52 scripts/build-emacs.sh
$(EMACS_VERSION
) $(EMACS_TARGET
) 53 emacs-install:emacs-
build;
54 cd $(EMACS_TARGET
) && make
install
57 ROCKSDB_TARGET:=build/src/rocksdb-
$(ROCKSDB_VERSION
) 58 rocksdb:scripts/
get-
rocksdb.
sh;
60 cd $(ROCKSDB_TARGET
) && \ 61 make
shared_lib
DISABLE_JEMALLOC=1 64 SBCL_TARGET:=build/src/sbcl-
$(SBCL_VERSION
) 66 $(SBCL_TARGET):scripts/
get-
sbcl.
sh $(B);
68 cd $(SBCL_TARGET
) && \ 69 echo '"2.3.12+main"' >
version.lisp-expr
&& \ 72 --with-mark-region-gc
\ 73 --with-core-compression
\ 74 --with-sb-xref-for-internals
\ 75 --dynamic-space-size
=4Gb
\ 79 sbcl-install:sbcl;
cd $(SBCL_TARGET) && ./
install.
sh 80 clean-sbcl:;
rm -
rf $(SBCL_TARGET) 83 RUST_TARGET:=build/src/rust-
$(RUST_VERSION
) 84 rust:scripts/
get-
rust.
sh $(B);
87 cargo
install
--path
$(RUST_TARGET
)/src/tools/x
88 rust-build:rust rust-
install-
x;
89 cd $(RUST_TARGET
) && x
build
library
90 rust-doc:rust rust-
install-
x;
91 cd $(RUST_TARGET
) && x
doc
92 rust-build-full:rust-
build;
93 cd $(RUST_TARGET
) && x
build
--stage
2 compiler/rustc
94 rust-install:rust-
build;
95 cd $(RUST_TARGET
) && x
install
98 TS_LANGS_TARGET:=build/src/ts-langs
99 ts-langs:scripts/
ts-
install-
langs.
sh # this requires sudo for now 102 CODE_TARGET:=build/src/
$(SRC
) 103 code:scripts/
get-
code.
sh $(B) 106 clean-code::;
rm -
rf $(CODE_TARGET) 109 dev-pod:virt/
build-
pod.
sh 111 archlinux:virt/
build-
archlinux-
base.
sh 113 fedora:virt/
build-
fedora-
base.
sh 115 box:virt/
build-
box-
base.
sh 117 bbdb:virt/
build-
bbdb-
base.
sh 119 heptapod:virt/
build-
heptapod.
sh 121 heptapod-runner:virt/
build-
heptapod-
runner.
sh 124 vc-pod:heptapod heptapod-
runner 129 dist/bundle:scripts/
bundle-
dir.
sh $(D) 137 $(SBCL_TARGET
)/install.sh
--prefix
=$(D
) 139 dist/linux:linux $(D);
141 dist/rocksdb:rocksdb $(D);
143 cp
-rf
include/*
$(D
) 144 cp
-f
librocksdb.so*
$(D
)/lib/
146 dist/rust:rust-
build $(D);
147 cd $(RUST_TARGET
) && x
dist
149 dist/emacs:emacs-
build $(D);
151 clean-dist:;
rm -
rf $(D) 152 clean-build:;
rm -
rf $(B)