-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (49 loc) · 1.14 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
ghc := ghc
ghcflags := -Wall -Werror
LLVMLIB=/usr/local
llvm_prefix ?= $(LLVMLIB)
prefix ?= $(LLVMLIB)
_lib := $(shell test -d /usr/lib64 && echo lib64 || echo lib)
ifeq ($(prefix),$(HOME))
user_flag := --user
endif
all: configure build
configure: configure.ac
autoreconf
.PHONY: build
build: dist/setup-config
./setup build
dist/setup-config: setup configure llvm.cabal llvm.buildinfo.in
./setup configure --user --prefix=$(prefix) --libdir=$(prefix)/$(_lib) \
--configure-option --with-llvm-prefix=$(llvm_prefix) $(user_flag)
setup: Setup.hs
$(ghc) --make -O -o $@ $<
configure: configure.ac
autoreconf
.PHONY: examples
examples:
$(MAKE) -C examples
.PHONY: tests
tests:
$(MAKE) -C tests
html: INSTALL.html PROBLEMS.html README.html
%.html: %.md
pandoc -s -o $@ $<
doc haddock: dist/setup-config
./setup haddock
sdist: dist/setup-config
./setup sdist
.PHONY: install
install: setup
./setup install
clean:
-$(MAKE) -C examples clean
-$(MAKE) -C tests clean
-$(MAKE) -C tools clean
-rm -f Setup.hi Setup.o
-./setup clean
-rm -f setup setup.exe setup.exe.manifest
-rm -f *~
-rm -rf dist
distclean: clean
-rm -f setup configure