diff options
-rw-r--r-- | compiler/ghc.mk | 12 | ||||
-rw-r--r-- | rts/ghc.mk | 25 | ||||
-rw-r--r-- | rts/include/ghc.mk | 14 | ||||
-rw-r--r-- | rules/build-package-way.mk | 2 | ||||
-rw-r--r-- | rules/build-prog.mk | 2 | ||||
-rw-r--r-- | rules/distdir-opts.mk | 14 | ||||
-rw-r--r-- | rules/distdir-way-opts.mk | 6 | ||||
-rw-r--r-- | rules/hs-suffix-way-rules-srcdir.mk | 8 | ||||
-rw-r--r-- | rules/hs-suffix-way-rules.mk | 4 | ||||
-rw-r--r-- | rules/manual-package-config.mk | 13 | ||||
-rw-r--r-- | utils/genapply/ghc.mk | 2 | ||||
-rw-r--r-- | utils/hp2ps/ghc.mk | 2 |
12 files changed, 53 insertions, 51 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk index bba143c801..4b33936afa 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -18,11 +18,6 @@ compiler_stage1_C_FILES_NODEPS = compiler/cbits/cutils.c -# We need to decrement the 1-indexed compiler stage to be the 0-indexed stage -# we use everwhere else. -dec1 = 0 -dec2 = 1 -dec3 = 2 # TODO(@Ericson2314) Get rid of compiler-specific stage indices. I think the # argument was stage n ghc is used to build stage n everything else, but I # don't buy that argument. @@ -113,11 +108,8 @@ PRIMOP_BITS_STAGE3 = $(addprefix compiler/stage3/build/,$(PRIMOP_BITS_NAMES)) define preprocessCompilerFiles # $1 = compiler stage (build system stage + 1) compiler/stage$1/build/primops.txt: \ - compiler/GHC/Builtin/primops.txt.pp \ - $(includes_$(dec$1)_H_CONFIG) \ - $(includes_$(dec$1)_H_PLATFORM) - $$(HS_CPP) -P $$(compiler_CPP_OPTS) \ - -Icompiler/stage$1 \ + compiler/GHC/Builtin/primops.txt.pp + $$(HS_CPP) -P \ -x c $$< | grep -v '^#pragma GCC' > $$@ compiler/stage$1/build/primop-data-decl.hs-incl: compiler/stage$1/build/primops.txt $$$$(genprimopcode_INPLACE) diff --git a/rts/ghc.mk b/rts/ghc.mk index 211741a2a9..6da6b2137e 100644 --- a/rts/ghc.mk +++ b/rts/ghc.mk @@ -214,7 +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,$$(BUILD_1_INCLUDE_DIRS)) \ + $$(addprefix -Irts/,$$(rts_dist-install_DIST_INCLUDE_DIRS)) \ -DDTRACE -s rts/RtsProbes.d \ -o $$@ \ $$(rts_$1_OBJS) @@ -377,22 +377,23 @@ WARNING_OPTS += -Wno-aggregate-return # support for registerised builds on this arch. -- BL 2010/02/03 # WARNING_OPTS += -Wcast-align -STANDARD_OPTS += \ - $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) \ - -Irts \ - -Irts/dist-install/build +rts_INCLUDE_DIRS = \ + $(addprefix include/,$(includes_INCLUDE_DIRS)) \ + . + +rts_dist-install_INCLUDE_DIRS = \ + $(addprefix include/,$(includes_dist-install_INCLUDE_DIRS)) # COMPILING_RTS is only used when building Win32 DLL support. -STANDARD_OPTS += -DCOMPILING_RTS -DFS_NAMESPACE=rts +rts_CPP_OPTS += -DCOMPILING_RTS -DFS_NAMESPACE=rts # HC_OPTS is included in both .c and .cmm compilations, whereas CC_OPTS is # only included in .c compilations. HC_OPTS included the WAY_* opts, which # must be included in both types of compilations. rts_CC_OPTS += $(WARNING_OPTS) -rts_CC_OPTS += $(STANDARD_OPTS) -rts_HC_OPTS += $(STANDARD_OPTS) -this-unit-id rts +rts_HC_OPTS += -this-unit-id rts ifneq "$(GhcWithSMP)" "YES" rts_CC_OPTS += -DNOSMP @@ -620,7 +621,7 @@ endif DTRACEPROBES_SRC = rts/RtsProbes.d $(DTRACEPROBES_H): $(DTRACEPROBES_SRC) $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM) | $$(dir $$@)/. - "$(DTRACE)" $(filter -I%,$(rts_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $< + "$(DTRACE)" $(filter -I%,$(rts_dist-install_DIST_CC_OPTS)) -C $(DTRACE_FLAGS) -h -o $@ -s $< endif # ----------------------------------------------------------------------------- @@ -635,7 +636,11 @@ ifeq "$(HaveLibMingwEx)" "YES" rts_PACKAGE_CPP_OPTS += -DHAVE_LIBMINGWEX endif -$(eval $(call manual-package-config,rts,dist-install,1)) +rts_dist-install_PACKAGE_CPP_OPTS = \ + $(rts_PACKAGE_CPP_OPTS) \ + $(addprefix -Irts/,$(rts_dist-install_DIST_INCLUDE_DIRS)) + +$(eval $(call manual-package-config,rts,dist-install)) rts/dist-install/package.conf.inplace : $(includes_dist-install_H_FILES) rts/dist-install/package.conf.install : $(includes_dist-install_H_FILES) diff --git a/rts/include/ghc.mk b/rts/include/ghc.mk index 12d14b9152..1b0fbff077 100644 --- a/rts/include/ghc.mk +++ b/rts/include/ghc.mk @@ -19,8 +19,15 @@ 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_1_INCLUDE_DIRS = rts/include rts/dist-install/build/include -BUILD_2_INCLUDE_DIRS = $(BUILD_1_INCLUDE_DIRS) +includes_INCLUDE_DIRS = . +# "includes" isn't really a separate component, but just part of the RTS that +# is in a separate ghc.mk for historical reasons. The ../dist-install puts the +# build products with the rest of the RTS's. +includes_dist-install_INCLUDE_DIRS = ../dist-install/build/include + +includes_dist-install_DIST_INCLUDE_DIRS = \ + $(includes_INCLUDE_DIRS) \ + $(includes_dist-install_INCLUDE_DIRS) # # All header files are in rts/include/{one of these subdirectories} @@ -63,8 +70,7 @@ ifeq "$(GhcUnregisterised)" "YES" includes_CC_OPTS += -DUSE_MINIINTERPRETER endif -includes_CC_OPTS += $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) -includes_CC_OPTS += -Irts +includes_CC_OPTS += $(addprefix -Irts/,$(rts_dist-install_DIST_INCLUDE_DIRS)) ifneq "$(GhcWithSMP)" "YES" includes_CC_OPTS += -DNOSMP diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index c1b95032ac..abc55c80c5 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -16,7 +16,7 @@ $(call trace, build-package-way($1,$2,$3)) $(call profStart, build-package-way($1,$2,$3)) $(call distdir-way-opts,$1,$2,$3,$4) -$(call hs-suffix-way-rules,$1,$2,$3,$4) +$(call hs-suffix-way-rules,$1,$2,$3) $(call hs-objs,$1,$2,$3) diff --git a/rules/build-prog.mk b/rules/build-prog.mk index 84d717e6b6..7973ecd38e 100644 --- a/rules/build-prog.mk +++ b/rules/build-prog.mk @@ -178,7 +178,7 @@ endif $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\ $$(eval $$(call hs-suffix-rules-srcdir,$1,$2,$$(dir)))) -$(call hs-suffix-way-rules,$1,$2,$$($1_$2_PROGRAM_WAY),$3) +$(call hs-suffix-way-rules,$1,$2,$$($1_$2_PROGRAM_WAY)) $(call c-objs,$1,$2,$$($1_$2_PROGRAM_WAY)) $(call hs-objs,$1,$2,$$($1_$2_PROGRAM_WAY)) diff --git a/rules/distdir-opts.mk b/rules/distdir-opts.mk index fe329c1d31..ebe56c1fd5 100644 --- a/rules/distdir-opts.mk +++ b/rules/distdir-opts.mk @@ -32,14 +32,22 @@ $1_$2_DIST_GCC_CC_OPTS = \ $$(CONF_CC_OPTS_STAGE$3) \ $$($1_$2_DIST_CC_OPTS) +$1_$2_DIST_INCLUDE_DIRS = \ + $$($1_$2_INCLUDE_DIRS) \ + $$($1_INCLUDE_DIRS) + +$1_$2_DIST_CPP_OPTS = \ + $$(foreach dir,$$(filter-out /%,$$($1_$2_DIST_INCLUDE_DIRS)),-I$1/$$(dir)) \ + $$(foreach dir,$$(filter /%,$$($1_$2_DIST_INCLUDE_DIRS)),-I$$(dir)) \ + $$($1_$2_CPP_OPTS) \ + $$($1_CPP_OPTS) + $1_$2_DIST_CC_OPTS = \ $$(SRC_CC_OPTS) \ $$($1_CC_OPTS) \ -I$1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen \ - $$(foreach dir,$$(filter-out /%,$$($1_$2_INCLUDE_DIRS)),-I$1/$$(dir)) \ - $$(foreach dir,$$(filter /%,$$($1_$2_INCLUDE_DIRS)),-I$$(dir)) \ + $$($1_$2_DIST_CPP_OPTS) \ $$($1_$2_CC_OPTS) \ - $$($1_$2_CPP_OPTS) \ $$($1_$2_CC_INC_FLAGS) \ $$($1_$2_DEP_CC_OPTS) \ $$(SRC_CC_WARNING_OPTS) diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk index a0dba3a1fe..098af4f8da 100644 --- a/rules/distdir-way-opts.mk +++ b/rules/distdir-way-opts.mk @@ -126,10 +126,8 @@ $1_$2_$3_MOST_HC_OPTS = \ -I$1/$2/build \ -i$1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen \ -I$1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen \ - $$(foreach dir,$$(filter-out /%,$$($1_$2_INCLUDE_DIRS)),-I$1/$$(dir)) \ - $$(foreach dir,$$(filter /%,$$($1_$2_INCLUDE_DIRS)),-I$$(dir)) \ - $$(foreach inc,$$($1_$2_INCLUDE),-\#include "$$(inc)") \ - $$(foreach opt,$$($1_$2_CPP_OPTS),-optP$$(opt)) \ + $$(foreach dir,$$(filter -I%,$$($1_$2_DIST_CPP_OPTS)),$$(dir)) \ + $$(foreach opt,$$(filter-out -I%,$$($1_$2_DIST_CPP_OPTS)),-optP$$(opt)) \ $$(if $$($1_PACKAGE),-optP-include \ -optP$1/$2/build/$$(or $$($1_EXECUTABLE),$$($1_$2_PROGNAME),.)/autogen/cabal_macros.h) \ $$($1_$2_$4_DEP_OPTS) \ diff --git a/rules/hs-suffix-way-rules-srcdir.mk b/rules/hs-suffix-way-rules-srcdir.mk index f9ab09107a..7223b553ba 100644 --- a/rules/hs-suffix-way-rules-srcdir.mk +++ b/rules/hs-suffix-way-rules-srcdir.mk @@ -12,7 +12,7 @@ define hs-suffix-way-rules-srcdir -# args: $1 = dir, $2 = distdir, $3 = way, $4 = srcdir, $5 = stage +# args: $1 = dir, $2 = distdir, $3 = way, $4 = srcdir ifneq "$$(BINDIST)" "YES" @@ -35,17 +35,15 @@ $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.lhs $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) # XXX: for some reason these get used in preference to the direct # .hs->.o rule, I don't know why --SDM -$1/$2/build/%.$$($3_osuf) : $1/$4/%.hc $$(includes_$5_H_CONFIG) $$(includes_$5_H_PLATFORM) | $$$$(dir $$$$@)/. +$1/$2/build/%.$$($3_osuf) : $1/$4/%.hc | $$$$(dir $$$$@)/. $$(call cmd,$1_$2_CC) \ $$($1_$2_$3_ALL_CC_OPTS) \ - $$(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) +$1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc $$(call cmd,$1_$2_CC) \ $$($1_$2_$3_ALL_CC_OPTS) \ - $$(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/hs-suffix-way-rules.mk b/rules/hs-suffix-way-rules.mk index daf1da4926..286e04eee7 100644 --- a/rules/hs-suffix-way-rules.mk +++ b/rules/hs-suffix-way-rules.mk @@ -11,7 +11,7 @@ # ----------------------------------------------------------------------------- -define hs-suffix-way-rules # args: $1 = dir, $2 = distdir, $3 = way, $4 = stage +define hs-suffix-way-rules # args: $1 = dir, $2 = distdir, $3 = way ifeq "$3 $$($1_$2_DYNAMIC_TOO)" "dyn YES" # We only want this rule to be used for Haskell sources, not for @@ -106,7 +106,7 @@ else # [1] https://www.gnu.org/software/make/manual/make.html#Implicit-Rule-Search $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\ - $$(eval $$(call hs-suffix-way-rules-srcdir,$1,$2,$3,$$(dir),$4))) + $$(eval $$(call hs-suffix-way-rules-srcdir,$1,$2,$3,$$(dir)))) ifneq "$$(BINDIST)" "YES" diff --git a/rules/manual-package-config.mk b/rules/manual-package-config.mk index dcd0e758bc..a9993d9fae 100644 --- a/rules/manual-package-config.mk +++ b/rules/manual-package-config.mk @@ -15,15 +15,13 @@ define manual-package-config # args: # $1 = dir # $2 = distdir -# $3 = stage -$(call trace, manual-package-config($1, $2, $3)) -$(call profStart, manual-package-config($1, $2, $3)) +$(call trace, manual-package-config($1, $2)) +$(call profStart, manual-package-config($1, $2)) $1/$2/package.conf.inplace : $1/package.conf.in $$$$(ghc-pkg_INPLACE) | $$$$(dir $$$$@)/. $$(HS_CPP) -P \ -DTOP='"$$(TOP)"' \ - $$($1_PACKAGE_CPP_OPTS) \ - $$(addprefix -I,$$(BUILD_$3_INCLUDE_DIRS)) \ + $$($1_$2_PACKAGE_CPP_OPTS) \ -x c $$< -o $$@.raw grep -v '^#pragma GCC' $$@.raw | \ sed -e 's/""//g' -e 's/:[ ]*,/: /g' > $$@ @@ -38,11 +36,10 @@ $1/$2/package.conf.install : $1/package.conf.in | $$$$(dir $$$$@)/. -DINSTALLING \ -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,$$(BUILD_$3_INCLUDE_DIRS)) \ + $$($1_$2_PACKAGE_CPP_OPTS) \ -x c $1/package.conf.in -o $$@.raw grep -v '^#pragma GCC' $$@.raw | \ sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@ -$(call profEnd, manual-package-config($1, $2, $3)) +$(call profEnd, manual-package-config($1)) endef diff --git a/utils/genapply/ghc.mk b/utils/genapply/ghc.mk index 363f8bb5d1..5721c9069a 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 += $(addprefix -I,$(BUILD_1_INCLUDE_DIRS)) +utils/genapply_dist_CC_OPTS += $(addprefix -Irts/include,$(includes_dist-install_DIST_INCLUDE_DIRS)) diff --git a/utils/hp2ps/ghc.mk b/utils/hp2ps/ghc.mk index a309e116a1..d7797be3e9 100644 --- a/utils/hp2ps/ghc.mk +++ b/utils/hp2ps/ghc.mk @@ -11,7 +11,6 @@ # ----------------------------------------------------------------------------- # 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 \ @@ -24,7 +23,6 @@ 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) |