changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > infra / makefile

changeset 17: aac1cf6cf2bb
parent: 87dd4724adfb
child: 3491c1d1815d
author: ellis <ellis@rwest.io>
date: Fri, 01 Dec 2023 23:20:45 -0500
permissions: -rw-r--r--
description: more scripts
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 B:=build
9 D:=$(realpath dist)
10 SRC:=comp
11 SHELL=/bin/sh
12 UNAME=$(shell uname)
13 CURL:=curl
14 CPU_COUNT:=$(shell getconf _NPROCESSORS_ONLN)
15 HG_COMMIT:=$(shell hg id -i)
16 VERSION:=
17 
18 VARS:=$(foreach v,$(filter-out $(__) __,$(.VARIABLES)),"\n$(v) = $($(v))")
19 
20 all:linux emacs rocksdb sbcl rust code virt dist;
21 
22 clean:clean-linux clean-code clean-sbcl clean-dist;
23 
24 ### Linux
25 LINUX_TARGET:=linux-$(LINUX_VERSION)
26 linux:$(LINUX_TARGET) linux-config;
27  mv build/$< dist/$<
28 $(LINUX_TARGET):scripts/get-linux.sh;
29  mkdir -pv build/$@
30  gpg --export autosigner@ torvalds@ gregkh@ > build/$@/keyring.gpg
31  $< $(LINUX_VERSION) build build/$@/keyring.gpg
32  cd build && unxz $@.tar.xz && tar -xvf $@.tar $(LINUX_TARGET)
33 linux-config:$(LINUX_TARGET);
34  cd build/$< && make mrproper -j && zcat /proc/config.gz > .config && yes N | make localmodconfig
35 clean-linux::;rm -rf build/$(LINUX_TARGET)
36 
37 ### Emacs
38 EMACS_TARGET:=build/src/emacs-$(EMACS_VERSION)
39 EMACS_DIST:=$(DIST)/src/emacs
40 emacs:scripts/get-emacs.sh;
41  $< $(EMACS_VERSION)
42 
43 emacs-build:emacs scripts/build-emacs.sh;
44  cd $(EMACS_TARGET)
45  ./autogen.sh
46  mkdir -pv $(EMACS_DIST)
47  scripts/build-emacs.sh $(EMACS_VERSION) $(EMACS_TARGET) $(EMACS_DIST)
48 
49 emacs-install:emacs-build;
50  cd $(EMACS_DIST)
51  make install
52 
53 ### RocksDB
54 ROCKSDB_TARGET:=build/src/rocksdb-$(ROCKSDB_VERSION)
55 rocksdb:scripts/get-rocksdb.sh;
56  $< $(ROCKSDB_VERSION)
57  cd $(ROCKSDB_TARGET)
58  make shared_lib DISABLE_JEMALLOC=1
59 
60 ### SBCL
61 SBCL_TARGET:=build/src/sbcl-$(SBCL_VERSION)
62 sbcl:scripts/get-sbcl.sh;
63  $< $(SBCL_VERSION)
64  cd $(SBCL_TARGET) && \
65  echo '"2.3.12+main"' > version.lisp-expr && \
66  sh make.sh \
67  --without-gencgc \
68  --with-mark-region-gc \
69  --with-core-compression \
70  --with-sb-xref-for-internals \
71  --dynamic-space-size=4Gb \
72  --fancy && \
73  cd doc/manual && make
74 clean-sbcl:;rm -rf $(SBCL_TARGET)
75 
76 ### Rust
77 RUST_TARGET:=build/src/rust-$(RUST_VERSION)
78 rust:scripts/get-rust.sh
79  $< $(RUST_VERSION)
80 rust-x:rust;
81  cargo install --path $(RUST_TARGET)/src/tools/x
82 rust-build:rust rust-install-x;
83  cd $(RUST_TARGET) && x build library
84 rust-doc:rust rust-install-x;
85  cd $(RUST_TARGET) && x doc
86 rust-build-full:rust-build;
87  cd $(RUST_TARGET) && x build --stage 2 compiler/rustc
88 rust-install:rust-build;
89  cd $(RUST_TARGET) && x install
90 
91 ### Code
92 CODE_TARGET:=build/src/$(SRC)
93 code:scripts/get-code.sh
94  $< $(SRC)
95 
96 clean-code::;rm -rf $(CODE_TARGET)
97 
98 ### Virt
99 dev-pod:virt/build-pod.sh
100  $<
101 archlinux:virt/build-archlinux-base.sh
102  $<
103 fedora:virt/build-fedora-base.sh
104  $<
105 box:virt/build-box-base.sh
106  $<
107 bbdb:virt/build-bbdb-base.sh
108  $<
109 heptapod:virt/build-heptapod.sh
110  $<
111 heptapod-runner:virt/build-heptapod-runner.sh
112  $<
113 
114 vc-pod:heptapod heptapod-runner
115 
116 virt:pod box bbdb vc
117 
118 ### Dist
119 dist/bundle:scripts/bundle-dir.sh
120  $<
121 
122 dist/cdn:cdn
123  mkdir -pv $@
124  cp -r $^ $@
125 
126 dist/sbcl:sbcl;
127  $(SBCL_TARGET)/install.sh --prefix=$(D)
128 
129 dist/linux:linux;
130 
131 dist/rocksdb:rocksdb;
132  cd $(ROCKSDB_TARGET)
133  cp -rf include/* $(D)
134  cp -f librocksdb.so* $(D)/lib/
135 
136 dist/rust:rust-build;
137  cd $(RUST_TARGET) && x dist
138 
139 dist/emacs:emacs;
140 
141 dist:dist/bundle dist/cdn dist/sbcl dist/rocksdb # dist/linux dist/rust
142 
143 clean-dist::;rm -rf dist/*
144 
145 ### Quickstart
146 quick:code