ghc.mk 3.02 KB
Newer Older
1
2
3
4
5
6
7
# -----------------------------------------------------------------------------
#
# (c) 2009 The University of Glasgow
#
# This file is part of the GHC build system.
#
# To understand how the build system works and how to modify it, see
8
9
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture
#      http://ghc.haskell.org/trac/ghc/wiki/Building/Modifying
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
utils/mkUserGuidePart_GENERATED_FLAGS_SETS := \
  codegen                     \
  compiler-debugging          \
  cpp                         \
  finding-imports             \
  interactive                 \
  interface-files             \
  keeping-intermediates       \
  language                    \
  linking                     \
  misc                        \
  modes                       \
  optimization                \
  optimization-levels         \
  packages                    \
  phase-programs              \
  phases                      \
  phase-specific              \
  platform-specific           \
  plugin                      \
  profiling                   \
  program-coverage            \
  recompilating-checking      \
  recompilation-checking      \
  redirecting-output          \
  temporary-files             \
  verbosity                   \
  warnings

42
43
44
45
46
# See Note [Blessed make target file]
utils/mkUserGuidePart_GENERATED_RST_SOURCES_BLESSED_FILE := \
		docs/users_guide/what_glasgow_exts_does.gen.rst

utils/mkUserGuidePart_GENERATED_RST_SOURCES_OTHER_FILES := \
47
		$(addprefix docs/users_guide/flags-,$(addsuffix .gen.rst,$(utils/mkUserGuidePart_GENERATED_FLAGS_SETS))) \
48
		docs/man/all-flags.gen.rst
49

50
51
52
53
utils/mkUserGuidePart_GENERATED_RST_SOURCES := \
		$(utils/mkUserGuidePart_GENERATED_RST_SOURCES_BLESSED_FILE) \
		$(utils/mkUserGuidePart_GENERATED_RST_SOURCES_OTHER_FILES)

54
55
utils/mkUserGuidePart_USES_CABAL           = YES
utils/mkUserGuidePart_PACKAGE              = mkUserGuidePart
56
utils/mkUserGuidePart_dist_PROGNAME        = mkUserGuidePart
57
utils/mkUserGuidePart_dist_INSTALL_INPLACE = YES
58

59
$(eval $(call build-prog,utils/mkUserGuidePart,dist,2))
60
61
$(eval $(call clean-target,utils/mkUserGuidePart,gen,$(utils/mkUserGuidePart_GENERATED_RST_SOURCES)))

62
63
64
$(utils/mkUserGuidePart_GENERATED_RST_SOURCES_OTHER_FILES) :

$(utils/mkUserGuidePart_GENERATED_RST_SOURCES_BLESSED_FILE) : $(utils/mkUserGuidePart_GENERATED_RST_SOURCES_OTHER_FILES) $(mkUserGuidePart_INPLACE)
65
	$(mkUserGuidePart_INPLACE)
66
	$(TOUCH_CMD) $@
67
68

all_utils/mkUserGuidePart: $(mkUserGuidePart_INPLACE)
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

# Note [Blessed make target file]
#
# make cannot express nicely a single build rule
# with multiple targets:
#
#   > all: a b
#   > a b:
#   > 	touch a b
#
# This code will run 'touch' rule twice when parallel
# make is used:
#   > $ make -j
#   > touch a b
#   > touch a b
#
# But there is a workaround for it:
# We pick a single file of a group and depend on it
# as an ultimate target. We also need to make sure
# that file has latest timestamp in the group:
#
#   > all: a b
#   > b:
#   > a: b
#   > 	touch a b
#   > 	touch $@