changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > infra / makefile

changeset 13: cb700df303f7
parent: 406b7640f3e4
child: 17a70918610c
author: ellis <ellis@rwest.io>
date: Sun, 26 Nov 2023 22:09:09 -0500
permissions: -rw-r--r--
description: rust
1 ### infra/makefile --- The Compiler Company Infrastructure
2 __ := $(.VARIABLES)
3 LINUX_VERSION:=$(shell uname -r | cut -d- -f1)
4 EMACS_VERSION:=main
5 ROCKSDB_VERSION:=main
6 SBCL_VERSION:=main
7 RUST_VERSION:=main
8 SRC:=comp
9 SHELL=/bin/sh
10 UNAME=$(shell uname)
11 CURL:=curl
12 CPU_COUNT:=$(shell getconf _NPROCESSORS_ONLN)
13 HG_COMMIT:=$(shell hg id -i)
14 VERSION:=
15 
16 VARS:=$(foreach v,$(filter-out $(__) __,$(.VARIABLES)),"\n$(v) = $($(v))")
17 
18 all:linux emacs rocksdb sbcl rust code virt dist;
19 
20 clean:linux-clean code-clean dist-clean;
21 
22 ### Linux
23 LINUX_TARGET:=linux-$(LINUX_VERSION)
24 linux:$(LINUX_TARGET) linux-config;
25  mv build/$< dist/$<
26 $(LINUX_TARGET):scripts/get-linux.sh;
27  mkdir -pv build/$@
28  gpg --export autosigner@ torvalds@ gregkh@ > build/$@/keyring.gpg
29  $< $(LINUX_VERSION) build build/$@/keyring.gpg
30  cd build && unxz $@.tar.xz && tar -xvf $@.tar $(LINUX_TARGET)
31 linux-config:$(LINUX_TARGET);
32  cd build/$< && make mrproper -j && zcat /proc/config.gz > .config && yes N | make localmodconfig
33 linux-clean::;rm -rf build/$(LINUX_TARGET)*
34 
35 ### Emacs
36 EMACS_TARGET:=emacs-$(EMACS_VERSION)
37 emacs:scripts/get-emacs.sh;
38  $< $(EMACS_VERSION)
39 
40 ### RocksDB
41 ROCKSDB_TARGET:=rocksdb-$(ROCKSDB_VERSION)
42 rocksdb:scripts/get-rocksdb.sh;
43  $< $(ROCKSDB_VERSION)
44 
45 ### SBCL
46 SBCL_TARGET:=sbcl-$(SBCL_VERSION)
47 sbcl:scripts/get-sbcl.sh;
48  $< $(SBCL_VERSION)
49 
50 ### Rust
51 RUST_TARGET:=rust-$(RUST_VERSION)
52 rust:scripts/get-rust.sh
53  $< $(RUST_VERSION)
54 rust-install-x:rust;
55  cargo install --path build/$(RUST_TARGET)/src/tools/x
56 rust-build:rust rust-install-x;
57  cd build/$(RUST_TARGET) && x build library
58 rust-doc:rust rust-install-x;
59  cd build/$(RUST_TARGET) && x doc
60 rust-build-full:rust-build;
61  cd build/$(RUST_TARGET) && x build --stage 2 compiler/rustc
62 rust-install:rust-build;
63  cd build/$(RUST_TARGET) && x install
64 rust-dist:rust-build;
65  cd build/$(RUST_TARGET) && x dist
66 ### Code
67 code:scripts/get-code.sh
68  $< $(SRC)
69 
70 code-clean::;rm -rf build/$(SRC)*
71 
72 ### Virt
73 pod:virt/build-pod.sh
74  $<
75 archlinux:virt/build-archlinux-base.sh
76  $<
77 fedora:virt/build-fedora-base.sh
78  $<
79 box:virt/build-box-base.sh
80  $<
81 bbdb:virt/build-bbdb-base.sh
82  $<
83 heptapod:virt/build-heptapod.sh
84  $<
85 heptapod-runner:virt/build-heptapod-runner.sh
86  $<
87 
88 vc:heptapod heptapod-runner
89 
90 virt:pod box bbdb vc
91 ### Web
92 
93 ### Dist
94 dist/code:scripts/bundle.sh
95  $<
96 
97 dist/cdn:cdn
98  cp -r $^ $@
99 
100 dist/sbcl:sbcl;
101 
102 dist/linux:linux;
103 
104 dist/rocksdb:rocksdb;
105 
106 dist/emacs:emacs;
107 
108 dist:dist/code dist/cdn dist/sbcl dist/linux dist/rocksdb
109 
110 dist-clean::;rm -rf dist/*