forked from dylan-lang/melange
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (29 loc) · 1.11 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
PARSERGEN = _build/bin/parsergen
MELANGE = _build/bin/melange
DESTDIR ?= /usr/local
INSTALLDIR = $(DESTDIR)/libexec/melange
GENERATED_PARSERS=melange-core/c-parse.dylan melange/int-parse.dylan
.PHONY: parsergen melange check clean all
all: melange
parsergen: $(PARSERGEN)
melange: $(MELANGE)
$(PARSERGEN): $(wildcard parsergen/*.dylan)
dylan-compiler -build parsergen
melange-core/c-parse.dylan: melange-core/c-parse.input $(PARSERGEN)
$(PARSERGEN) melange-core/c-parse.input melange-core/c-parse.dylan
melange/int-parse.dylan: melange/int-parse.input $(PARSERGEN)
$(PARSERGEN) melange/int-parse.input melange/int-parse.dylan
$(MELANGE): $(GENERATED_PARSERS) $(wildcard melange/*.dylan) $(wildcard melange-core/*.dylan)
dylan-compiler -build melange
check: $(MELANGE)
@cd tests && ./run.sh
clean:
rm -rf _build
rm -f melange-core/c-parse.dylan
rm -f melange/int-parse.dylan
install: melange
install -d $(INSTALLDIR) $(INSTALLDIR)/bin $(INSTALLDIR)/lib
cp -rp _build/bin/melange* $(INSTALLDIR)/bin
cp -rp _build/lib/* $(INSTALLDIR)/lib
install -d $(DESTDIR)/bin
ln -sf $(INSTALLDIR)/bin/melange $(DESTDIR)/bin/melange