forked from dylan-lang/deft
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (45 loc) · 1.64 KB
/
Makefile
File metadata and controls
54 lines (45 loc) · 1.64 KB
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
# Low-tech Makefile to build and install deft.
DYLAN ?= $${HOME}/dylan
.PHONY: build clean install remove-deft-artifacts test dist distclean
git_version := $(shell git describe --tags --always --match 'v*')
# Hack to add the version to the binary with Git tag info. During development I (cgay)
# just build with "deft build" so the unnecessary rebuilds that this would cause aren't
# an issue.
build:
deft update
file="sources/commands/version.dylan"; \
orig=$$(mktemp); \
temp=$$(mktemp); \
cp -p $${file} $${orig}; \
cat $${file} | sed "s|_NO_VERSION_SET_|${git_version} built on $$(date -Iseconds)|g" > $${temp}; \
mv $${temp} $${file}; \
deft build deft-app; \
cp -p $${orig} $${file}
install: build
mkdir -p $(DYLAN)/bin
mkdir -p $(DYLAN)/install/deft/bin
mkdir -p $(DYLAN)/install/deft/lib
cp _build/bin/deft-app $(DYLAN)/install/deft/bin/deft
cp -r _build/lib/lib* $(DYLAN)/install/deft/lib/
# For unified exe these could be hard links but for now they must be symlinks so
# that the relative paths to ../lib are correct. With --unify I ran into the
# "libunwind.so not found" bug.
ln -s -f $$(realpath $(DYLAN)/install/deft/bin/deft) $(DYLAN)/bin/deft
# For temp backward compatibility...
ln -s -f $$(realpath $(DYLAN)/install/deft/bin/deft) $(DYLAN)/bin/deft-app
ln -s -f $$(realpath $(DYLAN)/install/deft/bin/deft) $(DYLAN)/bin/dylan
test:
deft update
deft test
dist: distclean install
clean:
rm -rf _packages
rm -rf registry
rm -rf _build
rm -rf _test
find . -name '*~' -exec rm -f {} \;
distclean: clean
rm -rf $(DYLAN)/install/deft
rm -f $(DYLAN)/bin/deft
rm -f $(DYLAN)/bin/deft-app
rm -f $(DYLAN)/bin/dylan