changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > infra / makefile

changeset 23: 4300e14bb1db
parent: 3491c1d1815d
child: 3e8310575574
author: ellis <ellis@rwest.io>
date: Tue, 05 Dec 2023 23:12:16 -0500
permissions: -rw-r--r--
description: goodnight
1 ### infra/makefile --- The Compiler Company Infrastructure
2 
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.
5 
6 # If possible, use the packy (packy.compiler.company) to find and
7 # download a prepared bundle that suits your project needs.
8 
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,
13 # etc)
14 
15 VERSION="0.1.0"
16 LINUX_VERSION:=$(shell uname -r | cut -d- -f1)
17 EMACS_VERSION:=main
18 ROCKSDB_VERSION:=main
19 SBCL_VERSION:=main
20 RUST_VERSION:=main
21 B:=build
22 D:=dist
23 SRC:=comp
24 HG_COMMIT:=$(shell hg id -i)
25 
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
30 $(D):;mkdir -pv $@
31 ### Linux
32 LINUX_TARGET:=linux-$(LINUX_VERSION)
33 linux:$(LINUX_TARGET) linux-config;
34  mv build/$< dist/$<
35 $(LINUX_TARGET):scripts/get-linux.sh;
36  mkdir -pv build/$@
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)
43 
44 ### Emacs
45 EMACS_TARGET:=build/src/emacs-$(EMACS_VERSION)
46 EMACS_DIST:=$(D)/src/emacs
47 emacs:$(B) scripts/get-emacs.sh;
48  $< $(EMACS_VERSION)
49 
50 emacs-build:emacs scripts/build-emacs.sh;
51  cd $(EMACS_TARGET)
52  ./autogen.sh
53  mkdir -pv $(EMACS_DIST)
54  scripts/build-emacs.sh $(EMACS_VERSION) $(EMACS_TARGET) $(EMACS_DIST)
55 
56 emacs-install:emacs-build;
57  cd $(EMACS_DIST)
58  make install
59 
60 ### RocksDB
61 ROCKSDB_TARGET:=build/src/rocksdb-$(ROCKSDB_VERSION)
62 rocksdb:scripts/get-rocksdb.sh;
63  $< $(ROCKSDB_VERSION)
64  cd $(ROCKSDB_TARGET)
65  make shared_lib DISABLE_JEMALLOC=1
66 
67 ### SBCL
68 SBCL_TARGET:=build/src/sbcl-$(SBCL_VERSION)
69 sbcl:scripts/get-sbcl.sh $(B);
70  $< $(SBCL_VERSION)
71  cd $(SBCL_TARGET) && \
72  echo '"2.3.12+main"' > version.lisp-expr && \
73  sh make.sh \
74  --without-gencgc \
75  --with-mark-region-gc \
76  --with-core-compression \
77  --with-sb-xref-for-internals \
78  --dynamic-space-size=4Gb \
79  --fancy && \
80  cd doc/manual && make
81 clean-sbcl:;rm -rf $(SBCL_TARGET)
82 
83 ### Rust
84 RUST_TARGET:=build/src/rust-$(RUST_VERSION)
85 rust:scripts/get-rust.sh $(B);
86  $< $(RUST_VERSION)
87 rust-x:rust;
88  cargo install --path $(RUST_TARGET)/src/tools/x
89 rust-build:rust rust-install-x;
90  cd $(RUST_TARGET) && x build library
91 rust-doc:rust rust-install-x;
92  cd $(RUST_TARGET) && x doc
93 rust-build-full:rust-build;
94  cd $(RUST_TARGET) && x build --stage 2 compiler/rustc
95 rust-install:rust-build;
96  cd $(RUST_TARGET) && x install
97 
98 ### Code
99 CODE_TARGET:=build/src/$(SRC)
100 code:scripts/get-code.sh $(B)
101  $< $(SRC)
102 
103 clean-code::;rm -rf $(CODE_TARGET)
104 
105 ### Virt
106 dev-pod:virt/build-pod.sh
107  $<
108 archlinux:virt/build-archlinux-base.sh
109  $<
110 fedora:virt/build-fedora-base.sh
111  $<
112 box:virt/build-box-base.sh
113  $<
114 bbdb:virt/build-bbdb-base.sh
115  $<
116 heptapod:virt/build-heptapod.sh
117  $<
118 heptapod-runner:virt/build-heptapod-runner.sh
119  $<
120 
121 vc-pod:heptapod heptapod-runner
122 
123 virt:pod box bbdb vc
124 
125 ### Dist
126 dist/bundle:scripts/bundle-dir.sh $(D)
127  $<
128 
129 dist/cdn:cdn $(D)
130  mkdir -pv $@
131  cp -r $^ $@
132 
133 dist/sbcl:sbcl $(D);
134  $(SBCL_TARGET)/install.sh --prefix=$(D)
135 
136 dist/linux:linux $(D);
137 
138 dist/rocksdb:rocksdb $(D);
139  cd $(ROCKSDB_TARGET)
140  cp -rf include/* $(D)
141  cp -f librocksdb.so* $(D)/lib/
142 
143 dist/rust:rust-build $(D);
144  cd $(RUST_TARGET) && x dist
145 
146 dist/emacs:emacs-build $(D);
147 
148 clean-dist:;rm -rf $(D)
149 clean-build:;rm -rf $(B)
150 
151 ### Quickstart
152 quick:init code