-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
executable file
·69 lines (54 loc) · 1.77 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
67
68
# Toplevel Makefile for GreenCard
#
# Typical usage:
#
# Linux: sudo make install
# sudo make prefix=$HOME install
# Windows: make prefix=c:/greencard install
#
# === User serviceable parts:
# Path to Haskell compiler
HC=ghc
# Path to C compiler
CC = gcc
# When building for GHC, we can build for profiling, etc.
WAYS=p
# You only need to adjust these if you
# should need to change the parser
HAPPY = happy
# Set to 1 if you're compiling for Win32
PURE_WIN32=0
# [ The effect of this option is to control whether
# ';' (PURE_WIN32=1) or ':' (PURE_WIN32=0) is used
# as path separator when GreenCard processes the -i
# option.
# ]
# installation directories - override when invoking make
prefix = /usr/local
bindir = $(prefix)/bin
libdir = $(prefix)/lib/greencard-3.01
# === End of user-serviceable parts
HC_NAME = $(notdir $(shell which $(HC)))
# What system you're building for.
# Legal values: GHC, NHC or HUGS
FOR_SYSTEM:=$(shell bash -c "case ${HC} in (*ghc*) echo GHC ;; (*hugs*) echo HUGS ;; (*nhc*) echo NHC ;; esac")
SUBDIRS = src lib
ifneq "$(FOR_SYSTEM)" "GHC"
WAYS=
endif
all clean install install-pkg uninstall uninstall-pkg ::
@for way in "" $(WAYS) ; do \
for i in $(SUBDIRS) ; do \
$(MAKE) -C $$i -f Makefile $(MFLAGS) $@ way=$${way} bindir='$(bindir)' libdir='$(libdir)' FOR_SYSTEM='$(FOR_SYSTEM)' HC='$(HC)' CC='$(CC)' HAPPY='$(HAPPY)' PURE_WIN32=$(PURE_WIN32); \
done \
done
show-install :
@echo "bindir = $(bindir)"
@echo "libdir = $(libdir)"
@echo "FOR_SYSTEM = $(FOR_SYSTEM)"
@echo "HC = $(HC)"
@echo "HC_NAME = $(HC_NAME)"
@echo "WAYS = $(WAYS)"
@echo "CC = $(CC)"
@echo "HAPPY = $(HAPPY)"
@echo "PURE_WIN32 = $(PURE_WIN32)"