-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile.common
More file actions
31 lines (24 loc) · 898 Bytes
/
Makefile.common
File metadata and controls
31 lines (24 loc) · 898 Bytes
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
# $(MAKEFILE_LIST) is a list of the current makefiles being processed; the
# most-recently included makefile (us) is last.
top_level_dir = $(dir $(lastword $(MAKEFILE_LIST)))
ghc_compilation_opts = -O2
ghc_warning_opts = -fwarn-unused-imports -fwarn-missing-signatures \
-fwarn-unused-do-bind -fwarn-incomplete-patterns \
-fwarn-tabs
ghc_include_opts = -i$(top_level_dir)/common
ifdef DEBUG
ghc_debug_opts = -rtsopts -prof -auto-all
else
ghc_debug_opts =
endif
ghc_common_opts = $(ghc_warning_opts) $(ghc_include_opts)
all_ghc_opts = $(ghc_compilation_opts) $(ghc_common_opts) $(ghc_debug_opts) $(ghc_opts)
all : $(execs)
clean :
rm -f *.hi *.o $(execs)
print-common-ghc-opts :
@echo $(ghc_common_opts)
% : %.hs *.hs Makefile
ghc --make -main-is $@ $(all_ghc_opts) $<
%.hi %.o : %.hs
ghc --make -c $(all_ghc_opts) $<