diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-11-11 05:36:50 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-15 10:18:32 -0500 |
commit | 25d36c3178945d926f936ee32e57894d1743063c (patch) | |
tree | 9b1e21bcbb3be1775af7d608e10ea4fd322144ff | |
parent | 3e5f0595eaa732fdbf1c273194280105bb5bd862 (diff) | |
download | haskell-25d36c3178945d926f936ee32e57894d1743063c.tar.gz |
Make: Get rid of GHC_INCLUDE_DIRS
These dirs should not be included in all stages. Instead make the
per-stage `BUILD_*_INCLUDE_DIR` "plural" to insert `rts/include` in the
right place.
-rw-r--r-- | compiler/ghc.mk | 9 | ||||
-rw-r--r-- | mk/tree.mk | 1 | ||||
-rw-r--r-- | rts/ghc.mk | 6 | ||||
-rw-r--r-- | rts/include/ghc.mk | 8 | ||||
-rw-r--r-- | rules/hs-suffix-way-rules-srcdir.mk | 6 | ||||
-rw-r--r-- | rules/manual-package-config.mk | 6 | ||||
-rw-r--r-- | utils/genapply/ghc.mk | 2 | ||||
-rw-r--r-- | utils/hp2ps/ghc.mk | 4 |
8 files changed, 16 insertions, 26 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 07ee636b2b..c35c12706b 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -134,7 +134,6 @@ compiler/stage$1/build/primops.txt: \ $(includes_$(dec$1)_H_PLATFORM) $$(HS_CPP) -P $$(compiler_CPP_OPTS) \ -Icompiler/stage$1 \ - -I$(BUILD_$(dec$1)_INCLUDE_DIR) \ -x c $$< | grep -v '^#pragma GCC' > $$@ compiler/stage$1/build/primop-data-decl.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE) @@ -312,15 +311,15 @@ compiler_stage3_CONFIGURE_OPTS += --disable-library-for-ghci # after build-package, because that sets compiler_stage1_HC_OPTS: -compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) -$(foreach n,1 2 3,$(eval compiler_stage$n_CPP_OPTS += -I$(BUILD_$(dec$n)_INCLUDE_DIR))) +$(foreach n,1 2 3,\ + $(eval compiler_stage$n_CPP_OPTS += $$(addprefix -I,$$(BUILD_$(dec$n)_INCLUDE_DIRS)))) compiler_CPP_OPTS += ${GhcCppOpts} # We add these paths to the Haskell compiler's #include search path list since # we must avoid #including files by paths relative to the source file as Hadrian # moves the build artifacts out of the source tree. See #8040. -compiler_HC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) -$(foreach n,1 2 3,$(eval compiler_stage$n_HC_OPTS += -I$(BUILD_$(dec$n)_INCLUDE_DIR))) +$(foreach n,1 2 3,\ + $(eval compiler_stage$n_HP_OPTS += $$(addprefix -I,$$(BUILD_$(dec$n)_INCLUDE_DIRS)))) ifeq "$(V)" "0" compiler_stage1_HC_OPTS += $(filter-out -Rghc-timing,$(GhcHcOpts)) $(GhcStage1HcOpts) diff --git a/mk/tree.mk b/mk/tree.mk index 216cc8ba2b..a8925d60c3 100644 --- a/mk/tree.mk +++ b/mk/tree.mk @@ -10,7 +10,6 @@ # indicates a directory relative to the top of the source tree. GHC_UTILS_DIR = utils -GHC_INCLUDE_DIRS = rts/include rts/dist-install/build/include GHC_RTS_DIR = rts GHC_DRIVER_DIR = driver diff --git a/rts/ghc.mk b/rts/ghc.mk index 3643e07e9e..211741a2a9 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -214,8 +214,7 @@ rts_$1_DTRACE_OBJS = rts/dist-install/build/RtsProbes.$$($1_osuf) $$(rts_$1_DTRACE_OBJS) : $$(rts_$1_OBJS) $(DTRACE) -G -C \ - $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) \ - -I$$(BUILD_1_INCLUDE_DIR) \ + $$(addprefix -I,$$(BUILD_1_INCLUDE_DIRS)) \ -DDTRACE -s rts/RtsProbes.d \ -o $$@ \ $$(rts_$1_OBJS) @@ -379,8 +378,7 @@ WARNING_OPTS += -Wno-aggregate-return # WARNING_OPTS += -Wcast-align STANDARD_OPTS += \ - $(addprefix -I,$(GHC_INCLUDE_DIRS)) \ - -I$(BUILD_1_INCLUDE_DIR) \ + $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) \ -Irts \ -Irts/dist-install/build diff --git a/rts/include/ghc.mk b/rts/include/ghc.mk index 7bc4fc2d8b..12d14b9152 100644 --- a/rts/include/ghc.mk +++ b/rts/include/ghc.mk @@ -19,9 +19,8 @@ includes_2_H_CONFIG = $(includes_1_H_CONFIG) includes_1_H_PLATFORM = rts/dist-install/build/include/ghcplatform.h includes_2_H_PLATFORM = $(includes_1_H_PLATFORM) -BUILD_0_INCLUDE_DIR = rts/dist/build/include -BUILD_1_INCLUDE_DIR = rts/dist-install/build/include -BUILD_2_INCLUDE_DIR = $(BUILD_1_INCLUDE_DIR) +BUILD_1_INCLUDE_DIRS = rts/include rts/dist-install/build/include +BUILD_2_INCLUDE_DIRS = $(BUILD_1_INCLUDE_DIRS) # # All header files are in rts/include/{one of these subdirectories} @@ -64,8 +63,7 @@ ifeq "$(GhcUnregisterised)" "YES" includes_CC_OPTS += -DUSE_MINIINTERPRETER endif -includes_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) -includes_CC_OPTS += -I$(BUILD_1_INCLUDE_DIR) +includes_CC_OPTS += $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) includes_CC_OPTS += -Irts ifneq "$(GhcWithSMP)" "YES" diff --git a/rules/hs-suffix-way-rules-srcdir.mk b/rules/hs-suffix-way-rules-srcdir.mk index 1d01f95219..f9ab09107a 100644 --- a/rules/hs-suffix-way-rules-srcdir.mk +++ b/rules/hs-suffix-way-rules-srcdir.mk @@ -38,16 +38,14 @@ $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.lhs $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) $1/$2/build/%.$$($3_osuf) : $1/$4/%.hc $$(includes_$5_H_CONFIG) $$(includes_$5_H_PLATFORM) | $$$$(dir $$$$@)/. $$(call cmd,$1_$2_CC) \ $$($1_$2_$3_ALL_CC_OPTS) \ - $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) \ - -I$$(BUILD_$5_INCLUDE_DIR) \ + $$(addprefix -I,$$(BUILD_$5_INCLUDE_DIRS)) \ -x c -c $$< -o $$@ \ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf),$$(basename $$@))) $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc $$(includes_$5_H_CONFIG) $$(includes_$5_H_PLATFORM) $$(call cmd,$1_$2_CC) \ $$($1_$2_$3_ALL_CC_OPTS) \ - $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) \ - -I$$(BUILD_$5_INCLUDE_DIR) \ + $$(addprefix -I,$$(BUILD_$5_INCLUDE_DIRS)) \ -x c -c $$< -o $$@ \ $$(if $$(findstring YES,$$($1_$2_DYNAMIC_TOO)),-dyno $$(addsuffix .$$(dyn_osuf),$$(basename $$@))) diff --git a/rules/manual-package-config.mk b/rules/manual-package-config.mk index 72c3a369b6..dcd0e758bc 100644 --- a/rules/manual-package-config.mk +++ b/rules/manual-package-config.mk @@ -23,8 +23,7 @@ $1/$2/package.conf.inplace : $1/package.conf.in $$$$(ghc-pkg_INPLACE) | $$$$(dir $$(HS_CPP) -P \ -DTOP='"$$(TOP)"' \ $$($1_PACKAGE_CPP_OPTS) \ - $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) \ - -I$$(BUILD_$3_INCLUDE_DIR) \ + $$(addprefix -I,$$(BUILD_$3_INCLUDE_DIRS)) \ -x c $$< -o $$@.raw grep -v '^#pragma GCC' $$@.raw | \ sed -e 's/""//g' -e 's/:[ ]*,/: /g' > $$@ @@ -40,8 +39,7 @@ $1/$2/package.conf.install : $1/package.conf.in | $$$$(dir $$$$@)/. -DLIB_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))/$1"' \ -DINCLUDE_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))/$1/include"' \ $$($1_PACKAGE_CPP_OPTS) \ - $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) \ - -I$$(BUILD_$3_INCLUDE_DIR) \ + $$(addprefix -I,$$(BUILD_$3_INCLUDE_DIRS)) \ -x c $1/package.conf.in -o $$@.raw grep -v '^#pragma GCC' $$@.raw | \ sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@ diff --git a/utils/genapply/ghc.mk b/utils/genapply/ghc.mk index 8da1f7aaf6..363f8bb5d1 100644 --- a/utils/genapply/ghc.mk +++ b/utils/genapply/ghc.mk @@ -27,4 +27,4 @@ $(eval $(call build-prog,utils/genapply,dist,0)) # Purposely do the wrong stage for HOST := TARGET hack. # See Note [Genapply target as host for RTS macros]. -utils/genapply_dist_CC_OPTS += -I,$(BUILD_1_INCLUDE_DIR) +utils/genapply_dist_CC_OPTS += $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) diff --git a/utils/hp2ps/ghc.mk b/utils/hp2ps/ghc.mk index 75baa9ac4d..a309e116a1 100644 --- a/utils/hp2ps/ghc.mk +++ b/utils/hp2ps/ghc.mk @@ -10,9 +10,8 @@ # # ----------------------------------------------------------------------------- -utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) - # stage0 +utils/hp2ps_dist_CC_OPTS += $(addprefix -I,$(BUILD_0_INCLUDE_DIRS)) utils/hp2ps_dist_C_SRCS = AreaBelow.c Curves.c Error.c Main.c \ Reorder.c TopTwenty.c AuxFile.c Deviation.c \ HpFile.c Marks.c Scale.c TraceElement.c \ @@ -25,6 +24,7 @@ utils/hp2ps_dist_SHELL_WRAPPER = YES utils/hp2ps_dist_INSTALL_SHELL_WRAPPER_NAME = hp2ps # stage 1 +utils/hp2ps_dist-install_CC_OPTS += $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) utils/hp2ps_dist-install_C_SRCS = $(utils/hp2ps_dist_C_SRCS) utils/hp2ps_dist-install_EXTRA_LIBRARIES = $(utils/hp2ps_dist_EXTRA_LIBRARIES) utils/hp2ps_dist-install_PROGNAME = $(utils/hp2ps_dist_PROGNAME) |