changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > infra / makefile

changeset 25: 30fa758d74b7
parent: 3e8310575574
child: 319d5d0c5178
author: ellis <ellis@rwest.io>
date: Sun, 24 Dec 2023 13:37:49 -0500
permissions: -rw-r--r--
description: fixes
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_TARGET):scripts/get-emacs.sh $(B);
48  $< $(EMACS_VERSION)
49 emacs:$(EMACS_TARGET)
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
55 
56 ### RocksDB
57 ROCKSDB_TARGET:=build/src/rocksdb-$(ROCKSDB_VERSION)
58 rocksdb:scripts/get-rocksdb.sh;
59  $< $(ROCKSDB_VERSION)
60  cd $(ROCKSDB_TARGET) && \
61  make shared_lib DISABLE_JEMALLOC=1
62 
63 ### SBCL
64 SBCL_TARGET:=build/src/sbcl-$(SBCL_VERSION)
65 sbcl:scripts/get-sbcl.sh $(B);
66  $< $(SBCL_VERSION)
67  cd $(SBCL_TARGET) && \
68  echo '"2.3.12+main"' > version.lisp-expr && \
69  sh make.sh \
70  --without-gencgc \
71  --with-mark-region-gc \
72  --with-core-compression \
73  --with-sb-xref-for-internals \
74  --dynamic-space-size=4Gb \
75  --fancy && \
76  cd doc/manual && make
77 clean-sbcl:;rm -rf $(SBCL_TARGET)
78 
79 ### Rust
80 RUST_TARGET:=build/src/rust-$(RUST_VERSION)
81 rust:scripts/get-rust.sh $(B);
82  $< $(RUST_VERSION)
83 rust-x:rust;
84  cargo install --path $(RUST_TARGET)/src/tools/x
85 rust-build:rust rust-install-x;
86  cd $(RUST_TARGET) && x build library
87 rust-doc:rust rust-install-x;
88  cd $(RUST_TARGET) && x doc
89 rust-build-full:rust-build;
90  cd $(RUST_TARGET) && x build --stage 2 compiler/rustc
91 rust-install:rust-build;
92  cd $(RUST_TARGET) && x install
93 
94 ### Tree-sitter Langs
95 TS_LANGS_TARGET:=build/src/ts-langs
96 ts-langs:scripts/ts-install-langs.sh # this requires sudo for now
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