Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
1da6975a
Commit
1da6975a
authored
Mar 03, 2013
by
ian@well-typed.com
Browse files
Define $(prog)_INPLACE variables automatically, and start using them
parent
5d0801da
Changes
12
Hide whitespace changes
Inline
Side-by-side
compiler/ghc.mk
View file @
1da6975a
...
...
@@ -246,33 +246,33 @@ compiler/stage$1/build/Parser.y: compiler/parser/Parser.y.pp
compiler/stage$1/build/primops.txt
:
compiler/prelude/primops.txt.pp compiler/stage$1/$$(PLATFORM_H)
$
$(CPP)
$
$(RAWCPP_FLAGS)
-P
$
$(compiler_CPP_OPTS)
-Icompiler
/stage
$1
-x
c
$$
< |
grep
-v
'^#pragma GCC'
>
$$
@
compiler/stage$1/build/primop-data-decl.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--data-decl
<
$$
<
>
$$
@
compiler/stage$1/build/primop-tag.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--primop-tag
<
$$
<
>
$$
@
compiler/stage$1/build/primop-list.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--primop-list
<
$$
<
>
$$
@
compiler/stage$1/build/primop-has-side-effects.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--has-side-effects
<
$$
<
>
$$
@
compiler/stage$1/build/primop-out-of-line.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--out-of-line
<
$$
<
>
$$
@
compiler/stage$1/build/primop-commutable.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--commutable
<
$$
<
>
$$
@
compiler/stage$1/build/primop-code-size.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--code-size
<
$$
<
>
$$
@
compiler/stage$1/build/primop-can-fail.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--can-fail
<
$$
<
>
$$
@
compiler/stage$1/build/primop-strictness.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--strictness
<
$$
<
>
$$
@
compiler/stage$1/build/primop-fixity.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--fixity
<
$$
<
>
$$
@
compiler/stage$1/build/primop-primop-info.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--primop-primop-info
<
$$
<
>
$$
@
compiler/stage$1/build/primop-data-decl.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--data-decl
<
$$
<
>
$$
@
compiler/stage$1/build/primop-tag.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--primop-tag
<
$$
<
>
$$
@
compiler/stage$1/build/primop-list.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--primop-list
<
$$
<
>
$$
@
compiler/stage$1/build/primop-has-side-effects.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--has-side-effects
<
$$
<
>
$$
@
compiler/stage$1/build/primop-out-of-line.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--out-of-line
<
$$
<
>
$$
@
compiler/stage$1/build/primop-commutable.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--commutable
<
$$
<
>
$$
@
compiler/stage$1/build/primop-code-size.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--code-size
<
$$
<
>
$$
@
compiler/stage$1/build/primop-can-fail.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--can-fail
<
$$
<
>
$$
@
compiler/stage$1/build/primop-strictness.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--strictness
<
$$
<
>
$$
@
compiler/stage$1/build/primop-fixity.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--fixity
<
$$
<
>
$$
@
compiler/stage$1/build/primop-primop-info.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--primop-primop-info
<
$$
<
>
$$
@
# Usages aren't used any more; but the generator
# can still generate them if we want them back
compiler/stage$1/build/primop-usage.hs-incl
:
compiler/stage$1/build/primops.txt $$
(GENPRIMOP
_INPLACE)
"
$
$(
GENPRIMOP
_INPLACE)
"
--usage
<
$$
<
>
$$
@
compiler/stage$1/build/primop-usage.hs-incl
:
compiler/stage$1/build/primops.txt $$
$$(genprimopcode
_INPLACE)
"
$
$(
genprimopcode
_INPLACE)
"
--usage
<
$$
<
>
$$
@
endef
...
...
ghc.mk
View file @
1da6975a
...
...
@@ -549,8 +549,8 @@ endef
PRIMOPS_TXT_STAGE1
=
compiler/stage1/build/primops.txt
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs
:
$
(GENPRIMOP
_INPLACE) $(PRIMOPS_TXT_STAGE1) | $$(dir $$@)/.
"
$(
GENPRIMOP
_INPLACE)
"
--make-haskell-wrappers
<
$(PRIMOPS_TXT_STAGE1)
>
$@
libraries/ghc-prim/dist-install/build/GHC/PrimopWrappers.hs
:
$
$(genprimopcode
_INPLACE) $(PRIMOPS_TXT_STAGE1) | $$(dir $$@)/.
"
$(
genprimopcode
_INPLACE)
"
--make-haskell-wrappers
<
$(PRIMOPS_TXT_STAGE1)
>
$@
# Required so that Haddock documents the primops.
libraries/
ghc-prim_dist-install_EXTRA_HADDOCK_SRCS
=
libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs
...
...
@@ -655,7 +655,7 @@ BUILD_DIRS += utils/deriveConstants
BUILD_DIRS
+=
utils/testremove
BUILD_DIRS
+=
$(MAYBE_GHCTAGS)
BUILD_DIRS
+=
utils/ghc-pwd
BUILD_DIRS
+=
$(GHC_CABAL_DIR)
BUILD_DIRS
+=
utils/ghc-cabal
BUILD_DIRS
+=
$(MAYBE_HPC)
BUILD_DIRS
+=
$(MAYBE_RUNGHC)
BUILD_DIRS
+=
ghc
...
...
@@ -767,9 +767,9 @@ $(ghc-prim-$(libraries/ghc-prim_dist-install_VERSION)_HADDOCK_FILE): \
endif
# BINDIST
libraries/ghc-prim/dist-install/build/autogen/GHC/Prim.hs
:
\
$(PRIMOPS_TXT_STAGE1) $
(GENPRIMOP
_INPLACE)
\
$(PRIMOPS_TXT_STAGE1) $
$(genprimopcode
_INPLACE)
\
| $$(dir $$@)/.
"
$(
GENPRIMOP
_INPLACE)
"
--make-haskell-source
<
$<
>
$@
"
$(
genprimopcode
_INPLACE)
"
--make-haskell-source
<
$<
>
$@
.PHONY
:
tags
tags
:
tags_compiler
...
...
mk/config.mk.in
View file @
1da6975a
...
...
@@ -435,24 +435,14 @@ SRC_FLEX_OPTS += -8
# xxx the executable relative to the current dir
GHC_UNLIT_PGM
=
unlit
$(exeext)
GHC_HSC2HS_PGM
=
hsc2hs
$(exeext)
GHC_TOUCHY_PGM
=
touchy
$(exeext)
GHC_SPLIT_PGM
=
ghc-split
GHC_GENPRIMOP_PGM
=
genprimopcode
$(exeext)
GHC_GENAPPLY_PGM
=
genapply
$(exeext)
GHC_CABAL_PGM
=
ghc-cabal
$(exeext)
GHC_PKG_PGM
=
ghc-pkg
$(exeext)
GHC_MKDIRHIER_PGM
=
mkdirhier
SPLIT
=
$(INPLACE_LIB)
/
$(GHC_SPLIT_PGM)
UNLIT
=
$(INPLACE_LIB)
/
$(GHC_UNLIT_PGM)
TOUCHY
=
$(INPLACE_LIB)
/
$(GHC_TOUCHY_PGM)
MKDIRHIER
=
$(INPLACE_BIN)
/
$(GHC_MKDIRHIER_PGM)
GHC_CABAL_INPLACE
=
$(INPLACE_BIN)
/
$(GHC_CABAL_PGM)
GENAPPLY_INPLACE
=
$(INPLACE_BIN)
/
$(GHC_GENAPPLY_PGM)
GHC_PKG_INPLACE
=
$(INPLACE_BIN)
/
$(GHC_PKG_PGM)
HSC2HS_INPLACE
=
$(INPLACE_BIN)
/
$(GHC_HSC2HS_PGM)
GENPRIMOP_INPLACE
=
$(INPLACE_BIN)
/
$(GHC_GENPRIMOP_PGM)
TOUCHY
=
$(INPLACE_LIB)
/touchy
$(exeext)
MKDIRHIER
=
$(INPLACE_BIN)
/mkdirhier
GHC_CABAL_INPLACE
=
$(INPLACE_BIN)
/ghc-cabal
$(exeext)
GHC_PKG_INPLACE
=
$(INPLACE_BIN)
/ghc-pkg
$(exeext)
GENERATED_FILE
=
chmod
a-w
EXECUTABLE_FILE
=
chmod
+x
...
...
mk/tree.mk
View file @
1da6975a
...
...
@@ -20,8 +20,6 @@ GHC_INCLUDE_DIRS = includes includes/dist includes/dist-derivedconstants/
GHC_RTS_DIR
=
rts
GHC_DRIVER_DIR
=
driver
GHC_CABAL_DIR
=
$(GHC_UTILS_DIR)
/ghc-cabal
INPLACE
=
inplace
INPLACE_BIN
=
$(INPLACE)
/bin
INPLACE_LIB
=
$(INPLACE)
/lib
...
...
rts/ghc.mk
View file @
1da6975a
...
...
@@ -57,8 +57,8 @@ endif
rts_AUTO_APPLY_CMM
=
rts/dist/build/AutoApply.cmm
$(rts_AUTO_APPLY_CMM)
:
$
(GENAPPLY
_INPLACE)
"
$(
GENAPPLY
_INPLACE)
"
>
$@
$(rts_AUTO_APPLY_CMM)
:
$
$(genapply
_INPLACE)
"
$(
genapply
_INPLACE)
"
>
$@
rts/dist/build/sm/Evac_thr.c
:
rts/sm/Evac.c | $$(dir $$@)/.
cp
$<
$@
...
...
rules/build-prog.mk
View file @
1da6975a
...
...
@@ -87,15 +87,21 @@ else
$1_$2_INPLACE
=
endif
else
ifeq
"$(findstring clean,$(MAKECMDGOALS))" ""
ifneq
"$$($$($1_$2_PROG)_INPLACE)" ""
$$(error
$$($1_$2_PROG)_INPLACE
defined
twice)
endif
endif
ifeq
"$$($1_$2_TOPDIR)" "YES"
$$($1_$2_PROG)_INPLACE
=
$
$(INPLACE_TOPDIR)
/
$$
(
$1_$2_PROG
)
else
$$($1_$2_PROG)_INPLACE
=
$
$(INPLACE_BIN)
/
$$
(
$1_$2_PROG
)
endif
# Where do we install the inplace version?
ifeq
"$$($1_$2_WANT_INPLACE_WRAPPER)" "YES"
$1_$2_INPLACE
=
$
$(INPLACE_LIB)
/bin/
$$
(
$1_$2_PROG
)
else
ifeq
"$$($1_$2_TOPDIR)" "YES"
$1_$2_INPLACE
=
$
$(INPLACE_TOPDIR)
/
$$
(
$1_$2_PROG
)
else
$1_$2_INPLACE
=
$
$(INPLACE_BIN)
/
$$
(
$1_$2_PROG
)
endif
$1_$2_INPLACE
=
$$
(
$$
(
$1_$2_PROG
)
_INPLACE
)
endif
endif
...
...
rules/hs-suffix-rules-srcdir.mk
View file @
1da6975a
...
...
@@ -33,8 +33,8 @@ $1/$2/build/%.hs : $1/$2/build/%.y | $$$$(dir $$$$@)/.
$1/$2/build/%.hs
:
$1/$3/%.x | $$$$(dir $$$$@)/.
$
$(
call
cmd,ALEX
)
$$
(
$1_$2_ALL_ALEX_OPTS
)
$$
<
-o
$$
@
$1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs
:
$1/$3/%.hsc $$
(HSC2HS
_INPLACE) | $$$$(dir $$$$@)/.
$
$(
call
cmd,
HSC2HS
_INPLACE
)
$$
(
$1_$2_ALL_HSC2HS_OPTS
)
$$
<
-o
$$
@
$1/$2/build/%_hsc.c $1/$2/build/%_hsc.h $1/$2/build/%.hs
:
$1/$3/%.hsc $$
$$(hsc2hs
_INPLACE) | $$$$(dir $$$$@)/.
$
$(
call
cmd,
hsc2hs
_INPLACE
)
$$
(
$1_$2_ALL_HSC2HS_OPTS
)
$$
<
-o
$$
@
# Now the rules for hs-boot files.
...
...
rules/pretty_commands.mk
View file @
1da6975a
...
...
@@ -6,7 +6,7 @@ endif
label_ALEX
=
ALEX
label_HAPPY
=
HAPPY
label_
HSC2HS
_INPLACE
=
HSC2HS
label_
hsc2hs
_INPLACE
=
HSC2HS
...
...
utils/genapply/ghc.mk
View file @
1da6975a
...
...
@@ -11,7 +11,7 @@
# -----------------------------------------------------------------------------
utils/
genapply_dist_MODULES
=
GenApply
utils/
genapply_dist_PROG
=
$(GHC_GENAPPLY_PGM
)
utils/
genapply_dist_PROG
=
genapply
$(exeext
)
utils/
genapply_dist_INSTALL_INPLACE
=
YES
utils/
genapply_HC_OPTS
+=
-package
pretty
...
...
utils/genprimopcode/ghc.mk
View file @
1da6975a
...
...
@@ -11,7 +11,7 @@
# -----------------------------------------------------------------------------
utils/
genprimopcode_dist_MODULES
=
Lexer Main ParserM Parser Syntax
utils/
genprimopcode_dist_PROG
=
$(GHC_GENPRIMOP_PGM
)
utils/
genprimopcode_dist_PROG
=
genprimopcode
$(exeext
)
utils/
genprimopcode_dist_HC_OPTS
=
-package
array
utils/
genprimopcode_dist_INSTALL_INPLACE
=
YES
...
...
utils/ghc-cabal/ghc.mk
View file @
1da6975a
...
...
@@ -18,15 +18,15 @@ CABAL_DOTTED_VERSION := $(shell grep "^Version:" libraries/Cabal/Cabal/Cabal.cab
CABAL_VERSION
:=
$(
subst
.,
$(comma)
,
$(CABAL_DOTTED_VERSION)
)
CABAL_CONSTRAINT
:=
--constraint
=
"Cabal ==
$(CABAL_DOTTED_VERSION)
"
$(GHC_CABAL_INPLACE)
:
$(GHC_CABAL_DIR)
/dist/build/tmp/ghc-cabal$(exeext) | $$(dir $$@)/.
$(GHC_CABAL_INPLACE)
:
utils/ghc-cabal
/dist/build/tmp/ghc-cabal$(exeext) | $$(dir $$@)/.
"
$(CP)
"
$<
$@
$(GHC_CABAL_DIR)
/dist/build/tmp/ghc-cabal$(exeext)
:
$(wildcard libraries/Cabal/Cabal/Distribution/*/*/*.hs)
$(GHC_CABAL_DIR)
/dist/build/tmp/ghc-cabal$(exeext)
:
$(wildcard libraries/Cabal/Cabal/Distribution/*/*.hs)
$(GHC_CABAL_DIR)
/dist/build/tmp/ghc-cabal$(exeext)
:
$(wildcard libraries/Cabal/Cabal/Distribution/*.hs)
utils/ghc-cabal
/dist/build/tmp/ghc-cabal$(exeext)
:
$(wildcard libraries/Cabal/Cabal/Distribution/*/*/*.hs)
utils/ghc-cabal
/dist/build/tmp/ghc-cabal$(exeext)
:
$(wildcard libraries/Cabal/Cabal/Distribution/*/*.hs)
utils/ghc-cabal
/dist/build/tmp/ghc-cabal$(exeext)
:
$(wildcard libraries/Cabal/Cabal/Distribution/*.hs)
$(GHC_CABAL_DIR)
/dist/build/tmp/ghc-cabal$(exeext)
:
$(GHC_CABAL_DIR)
/Main.hs $(TOUCH_DEP) | $$(dir $$@)/. bootstrapping/.
"
$(GHC)
"
$(SRC_HC_OPTS)
--make
$(GHC_CABAL_DIR)
/Main.hs
-o
$@
\
utils/ghc-cabal
/dist/build/tmp/ghc-cabal$(exeext)
:
utils/ghc-cabal
/Main.hs $(TOUCH_DEP) | $$(dir $$@)/. bootstrapping/.
"
$(GHC)
"
$(SRC_HC_OPTS)
--make
utils/ghc-cabal
/Main.hs
-o
$@
\
-no-user-
$(GHC_PACKAGE_DB_FLAG)
\
-Wall
-fno-warn-unused-imports
-fno-warn-warnings-deprecations
\
-DCABAL_VERSION
=
$(CABAL_VERSION)
\
...
...
@@ -42,21 +42,21 @@ $(GHC_CABAL_DIR)/dist/build/tmp/ghc-cabal$(exeext): $(GHC_CABAL_DIR)/Main.hs $(T
# touch is required, because otherwise if mkdirhier is newer, we
# repeatedly rebuild ghc-cabal.
$(eval
$(call
clean-target,
$(GHC_CABAL_DIR)
,dist,\
$(GHC_CABAL_DIR)
/dist
bootstrapping))
$(eval
$(call
clean-target,
utils/ghc-cabal
,dist,\
utils/ghc-cabal
/dist
bootstrapping))
$(eval
$(call
all-target,
$(GHC_CABAL_DIR)
,$(GHC_CABAL_INPLACE)))
$(eval
$(call
all-target,
utils/ghc-cabal
,$(GHC_CABAL_INPLACE)))
# -----------------------------------------------------------------------------
# Now make another copy that goes in bindists. This needs to be built
# with the in-tree compiler.
$(GHC_CABAL_DIR)
_USES_CABAL
=
YES
$(GHC_CABAL_DIR)
_PACKAGE
=
ghc-cabal
$(GHC_CABAL_DIR)
_dist-install_PROG
=
ghc-cabal
$(exeext)
$(GHC_CABAL_DIR)
_dist-install_INSTALL_INPLACE
=
NO
$(GHC_CABAL_DIR)
_dist-install_WANT_BINDIST_WRAPPER
=
YES
$(GHC_CABAL_DIR)
_dist-install_MODULES
=
Main
utils/
ghc-cabal
_USES_CABAL
=
YES
utils/
ghc-cabal
_PACKAGE
=
ghc-cabal
utils/
ghc-cabal
_dist-install_PROG
=
ghc-cabal
$(exeext)
utils/
ghc-cabal
_dist-install_INSTALL_INPLACE
=
NO
utils/
ghc-cabal
_dist-install_WANT_BINDIST_WRAPPER
=
YES
utils/
ghc-cabal
_dist-install_MODULES
=
Main
$(eval
$(call
build-prog,utils/ghc-cabal,dist-install,1))
utils/touchy/ghc.mk
View file @
1da6975a
...
...
@@ -11,7 +11,7 @@
# -----------------------------------------------------------------------------
utils/
touchy_dist_C_SRCS
=
touchy.c
utils/
touchy_dist_PROG
=
$(GHC_TOUCHY_PGM
)
utils/
touchy_dist_PROG
=
touchy
$(exeext
)
utils/
touchy_dist_TOPDIR
=
YES
utils/
touchy_dist_INSTALL
=
YES
utils/
touchy_dist_INSTALL_INPLACE
=
YES
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment