-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
63 lines (50 loc) · 2.07 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
# Low-tech Makefile to build and install deft.
DYLAN ?= $${HOME}/dylan
install_dir = $(DYLAN)/install/deft
install_bin = $(install_dir)/bin
install_lib = $(install_dir)/lib
link_target = $(install_bin)/deft-app
link_source = $(DYLAN)/bin/dylan
git_version := "$(shell git describe --tags --always --match 'v*')"
.PHONY: build build-with-version clean install install-debug really-install remove-deft-artifacts test dist distclean
build: remove-deft-artifacts
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry dylan-compiler -build -unify deft-app
# Hack to add the version to the binary with git tag info. Don't want this to
# be the normal build because it causes unnecessary rebuilds.
build-with-version: remove-deft-artifacts
file="sources/commands/utils.dylan"; \
orig=$$(mktemp); \
temp=$$(mktemp); \
cp -p $${file} $${orig}; \
cat $${file} | sed "s,/.__./.*/.__./,/*__*/ \"${git_version}\" /*__*/,g" > $${temp}; \
mv $${temp} $${file}; \
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \
dylan-compiler -build -unify deft-app; \
cp -p $${orig} $${file}
# Until the install-deft GitHub Action is no longer referring to deft-app
# we also create a link named deft-app.
really-install:
mkdir -p $(DYLAN)/bin
cp _build/sbin/deft-app $(DYLAN)/bin/deft
ln -f $(DYLAN)/bin/deft $(DYLAN)/bin/deft-app
install: build-with-version really-install
# Build and install without the version hacking above.
install-debug: build really-install
# Deft needs to be buildable with submodules so that it can be built on
# new platforms without having to manually install deps.
test: build
OPEN_DYLAN_USER_REGISTRIES=${PWD}/registry \
dylan-compiler -build deft-test-suite \
&& DYLAN_CATALOG=ext/pacman-catalog _build/bin/deft-test-suite
dist: distclean install
# Sometimes I use deft to develop deft, so this makes sure to clean
# up its artifacts.
remove-deft-artifacts:
rm -rf _packages
find registry -not -path '*/generic/*' -type f -exec rm {} \;
clean: remove-deft-artifacts
rm -rf _build
rm -rf _test
distclean: clean
rm -rf $(install_dir)
rm -f $(link_source)