-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
56 lines (47 loc) · 1.69 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
all: build
.PHONY: build
OPEN_DYLAN_DIR = $(realpath $(dir $(realpath $(shell which dylan-compiler)))/..)
INSTALL_DIR ?= /opt/deft
APP_SOURCES = $(wildcard */*.dylan) \
$(wildcard */*.lid)
REGISTRIES = `pwd`/registry:`pwd`/ext/command-interface/registry:`pwd`/ext/json/registry:`pwd`/ext/serialization/registry:`pwd`/ext/http/registry
ifeq (, $(wildcard .git))
check-submodules:
else
check-submodules:
@for sms in `git submodule status --recursive | grep -v "^ " | cut -c 1`; do \
if [ "$$sms" != "x" ]; then \
echo "**** ERROR ****"; \
echo "One or more submodules is not up to date."; \
echo "Please run 'git submodule update --init --recursive'."; \
exit 1; \
fi; \
done;
endif
build: $(APP_SOURCES) check-submodules
OPEN_DYLAN_USER_REGISTRIES=$(REGISTRIES) dylan-compiler -build deft
# Install things we need to be able to build
mkdir -p _build/share/opendylan/
cp -frp $(OPEN_DYLAN_DIR)/share/opendylan/build-scripts _build/share/opendylan/
cp -rfp $(OPEN_DYLAN_DIR)/lib/runtime _build/lib/
if [ -d $(OPEN_DYLAN_DIR)/include ]; then \
cp -rfp $(OPEN_DYLAN_DIR)/include _build/; \
fi
ln -fs $(OPEN_DYLAN_DIR)/sources _build/
# deft-dfmc/tracing stuff:
mkdir -p _build/share/static/dfmc-tracing
cp -rp deft-dfmc/static/* _build/share/static/dfmc-tracing/
clean:
rm -rf _build/bin/deft*
rm -rf _build/lib/*deft*
rm -rf _build/build/deft*
install: build
mkdir -p $(INSTALL_DIR)
cp -rp _build/bin $(INSTALL_DIR)/
cp -rfp _build/lib $(INSTALL_DIR)/
cp -rp _build/share $(INSTALL_DIR)/
cp -rp _build/databases $(INSTALL_DIR)/
if [ -d _build/include ]; then \
cp -rfp _build/include $(INSTALL_DIR)/; \
fi
ln -fs $(OPEN_DYLAN_DIR)/sources $(INSTALL_DIR)/