-
-
Notifications
You must be signed in to change notification settings - Fork 412
/
makefile
100 lines (77 loc) · 2.72 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# SPDX-FileCopyrightText: Atlas Engineer LLC
# SPDX-License-Identifier: BSD-3-Clause
## Use Bourne shell syntax.
SHELL = /bin/sh
UNAME := $(shell uname)
LISP ?= sbcl
SBCL_FLAGS =
ifeq ($(LISP), sbcl)
SBCL_FLAGS=--dynamic-space-size $(shell sbcl --noinform --no-userinit --non-interactive --eval '(prin1 (max 3072 (/ (sb-ext:dynamic-space-size) 1024 1024)))' --quit | tail -1)
endif
LISP_FLAGS ?= $(SBCL_FLAGS) --no-userinit --non-interactive
NYXT_SUBMODULES ?= true
NYXT_RENDERER ?= gi-gtk
NASDF_USE_LOGICAL_PATHS ?= true
export NYXT_SUBMODULES
export NYXT_RENDERER
export NASDF_USE_LOGICAL_PATHS
.PHONY: help
help:
@cat INSTALL
makefile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
ifeq ($(NYXT_SUBMODULES),true)
CL_SOURCE_REGISTRY = $(makefile_dir)_build//
export CL_SOURCE_REGISTRY
endif
lisp_eval:=$(LISP) $(LISP_FLAGS) \
--eval '(require "asdf")' \
--eval '(asdf:load-asd "$(makefile_dir)/libraries/nasdf/nasdf.asd")' \
--eval '(asdf:load-asd "$(makefile_dir)/nyxt.asd")' \
--eval
lisp_quit:=--eval '(uiop:quit)'
## asdf:load-system is a bit slow on :nyxt/$(NYXT_RENDERER)-application, so we
## keep a Make dependency on the Lisp files.
lisp_files := nyxt.asd $(shell find . -type f -name '*.lisp')
nyxt: $(lisp_files)
$(lisp_eval) '(asdf:load-system :nyxt/$(NYXT_RENDERER)-application)' \
--eval '(asdf:make :nyxt/$(NYXT_RENDERER)-application)' \
$(lisp_quit) || (printf "\n%s\n%s\n" "Compilation failed, see the above stacktrace." && exit 1)
.PHONY: all
all: nyxt
.PHONY: install
install: all
$(lisp_eval) '(asdf:load-system :nyxt/$(NYXT_RENDERER)-application)' \
--eval '(asdf:make :nyxt/install)' $(lisp_quit)
.PHONY: doc
doc:
$(lisp_eval) '(asdf:load-system :nyxt)' \
--eval '(asdf:load-system :nyxt/documentation)' $(lisp_quit)
.PHONY: check
check:
$(lisp_eval) '(asdf:test-system :nyxt)'
.PHONY: clean-submodules
clean-submodules:
git submodule deinit --force --all
.PHONY: clean
clean: clean-submodules
rm -rf build
# Flatpak
FLATPAK_COMMAND = flatpak
FLATPAK_BUILDER = flatpak-builder
FLATPAK_APP_ID = engineer.atlas.Nyxt
FLATPAK_MANIFEST := $(FLATPAK_APP_ID).yaml
FLATPAK_EXPORT_REPOSITORY = _build/nyxt-flatpak-repository
.PHONY: flatpak-build
flatpak-build:
@$(FLATPAK_BUILDER) --force-clean --user --install --default-branch=local build $(FLATPAK_MANIFEST)
.PHONY: flatpak-run
flatpak-run:
@$(FLATPAK_COMMAND) update -y $(FLATPAK_APP_ID)
@$(FLATPAK_COMMAND) run --branch=local $(FLATPAK_APP_ID)
.PHONY: flatpak-repository
flatpak-repository:
mkdir -p $(FLATPAK_EXPORT_REPOSITORY)
@$(FLATPAK_BUILDER) --force-clean --repo=$(FLATPAK_EXPORT_REPOSITORY) build $(FLATPAK_MANIFEST)
.PHONY: flatpak-bundle
flatpak-bundle:
@$(FLATPAK_COMMAND) build-bundle $(FLATPAK_EXPORT_REPOSITORY) nyxt.flatpak $(FLATPAK_APP_ID)