Commit 9e452874 authored by Ian Lynagh's avatar Ian Lynagh

Refactoring

This is working towards being able to put ghcautoconf.h and
ghcplatform.h in includes/dist
parent 4c49eb51
......@@ -258,7 +258,7 @@ PRIMOP_BITS = compiler/primop-data-decl.hs-incl \
compiler/primop-strictness.hs-incl \
compiler/primop-primop-info.hs-incl
compiler_CPP_OPTS += -I$(GHC_INCLUDE_DIR)
compiler_CPP_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
compiler_CPP_OPTS += ${GhcCppOpts}
$(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H)
......
......@@ -1111,7 +1111,7 @@ ifeq "$(BootingFromHc)" "YES"
# flags explicitly to C compilations.
SRC_CC_OPTS += -DNO_REGS -DUSE_MINIINTERPRETER
SRC_CC_OPTS += -D__GLASGOW_HASKELL__=$(ProjectVersionInt)
SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR)
SRC_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
endif
# -----------------------------------------------------------------------------
......@@ -1132,10 +1132,12 @@ CLEAN_FILES += libraries/bootstrapping.conf
CLEAN_FILES += libraries/integer-gmp/cbits/GmpDerivedConstants.h
CLEAN_FILES += libraries/integer-gmp/cbits/mkGmpDerivedConstants
# These two are no longer generated, but we still clean them for a while
# These four are no longer generated, but we still clean them for a while
# as they may still be in old GHC trees:
CLEAN_FILES += includes/GHCConstants.h
CLEAN_FILES += includes/DerivedConstants.h
CLEAN_FILES += includes/ghcautoconf.h
CLEAN_FILES += includes/ghcplatform.h
clean : clean_files clean_libraries
......
......@@ -41,9 +41,7 @@ ifeq "$(GhcEnableTablesNextToCode) $(GhcUnregisterised)" "YES NO"
includes_CC_OPTS += -DTABLES_NEXT_TO_CODE
endif
includes_CC_OPTS += -Iincludes
includes_CC_OPTS += -Iincludes/dist-derivedconstants/header
includes_CC_OPTS += -Iincludes/dist-ghcconstants/header
includes_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
includes_CC_OPTS += -Irts
ifneq "$(GhcWithSMP)" "YES"
......@@ -65,7 +63,7 @@ $(includes_H_CONFIG) :
else
$(includes_H_CONFIG) : mk/config.h mk/config.mk includes/ghc.mk
$(includes_H_CONFIG) : mk/config.h mk/config.mk includes/ghc.mk | $$(dir $$@)/.
@echo "Creating $@..."
@echo "#ifndef __GHCAUTOCONF_H__" >$@
@echo "#define __GHCAUTOCONF_H__" >>$@
......@@ -76,7 +74,7 @@ $(includes_H_CONFIG) : mk/config.h mk/config.mk includes/ghc.mk
endif
$(includes_H_PLATFORM) : includes/Makefile
$(includes_H_PLATFORM) : includes/Makefile | $$(dir $$@)/.
$(call removeFiles,$@)
@echo "Creating $@..."
@echo "#ifndef __GHCPLATFORM_H__" >$@
......
......@@ -16,7 +16,7 @@ endif
# indicates a directory relative to the top of the source tree.
GHC_UTILS_DIR = utils
GHC_INCLUDE_DIR = includes
GHC_INCLUDE_DIRS = includes includes/dist includes/dist-derivedconstants/header includes/dist-ghcconstants/header
GHC_COMPILER_DIR = compiler
GHC_PROG_DIR = ghc
GHC_RTS_DIR = rts
......
......@@ -162,7 +162,7 @@ ifeq "$(TargetOS_CPP)" "solaris2"
rts_$1_DTRACE_OBJS = rts/dist/build/RtsProbes.$$($1_osuf)
rts/dist/build/RtsProbes.$$($1_osuf) : $$(rts_$1_OBJS)
$(DTRACE) -G -C -Iincludes -DDTRACE -s rts/RtsProbes.d -o \
$(DTRACE) -G -C $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) -DDTRACE -s rts/RtsProbes.d -o \
$$@ $$(rts_$1_OBJS)
endif
endif
......@@ -236,7 +236,7 @@ WARNING_OPTS += -Wredundant-decls
# support for registerised builds on this arch. -- BL 2010/02/03
# WARNING_OPTS += -Wcast-align
STANDARD_OPTS += -Iincludes -Irts -Irts/dist/build
STANDARD_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS)) -Irts -Irts/dist/build
# COMPILING_RTS is only used when building Win32 DLL support.
STANDARD_OPTS += -DCOMPILING_RTS
......
......@@ -51,7 +51,7 @@ extra-libraries:
#ifdef INSTALLING
include-dirs: INCLUDE_DIR PAPI_INCLUDE_DIR
#else /* !INSTALLING */
include-dirs: TOP"/rts/dist/build" TOP"/includes" TOP"/includes/dist-ghcconstants/header" TOP"/includes/dist-derivedconstants/header"
include-dirs: TOP"/rts/dist/build" TOP"/includes" TOP"/includes/dist" TOP"/includes/dist-ghcconstants/header" TOP"/includes/dist-derivedconstants/header"
#endif
includes: Stg.h
......
......@@ -52,10 +52,10 @@ endif
# .hs->.o rule, I don't know why --SDM
$1/$2/build/%.$$($3_osuf) : $1/$4/%.hc includes/ghcautoconf.h includes/ghcplatform.h | $$$$(dir $$$$@)/.
"$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@
"$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) -x c -c $$< -o $$@
$1/$2/build/%.$$($3_osuf) : $1/$2/build/%.hc includes/ghcautoconf.h includes/ghcplatform.h
"$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) -Iincludes -x c -c $$< -o $$@
"$$($1_$2_CC)" $$($1_$2_$3_ALL_CC_OPTS) $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) -x c -c $$< -o $$@
# $1/$2/build/%.$$($3_osuf) : $1/$2/build/%.$$($3_way_)hc
# "$$($1_$2_HC)" $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
......
......@@ -19,7 +19,7 @@ $1/package.conf.inplace : $1/package.conf.in $(GHC_PKG_INPLACE)
$$(CPP) $$(RAWCPP_FLAGS) -P \
-DTOP='"$$(TOP)"' \
$$($1_PACKAGE_CPP_OPTS) \
-x c -I$$(GHC_INCLUDE_DIR) $$< -o $$@.raw
-x c $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) $$< -o $$@.raw
grep -v '^#pragma GCC' $$@.raw | \
sed -e 's/""//g' -e 's/:[ ]*,/: /g' > $$@
......@@ -34,7 +34,7 @@ $1/package.conf.install:
-DLIB_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))"' \
-DINCLUDE_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))/include"' \
$$($1_PACKAGE_CPP_OPTS) \
-x c -I$$(GHC_INCLUDE_DIR) $1/package.conf.in -o $$@.raw
-x c $$(addprefix -I,$$(GHC_INCLUDE_DIRS)) $1/package.conf.in -o $$@.raw
grep -v '^#pragma GCC' $$@.raw | \
sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@
......
......@@ -19,8 +19,8 @@ ifeq "$(GhcUnregisterised)" "YES"
utils/genapply_HC_OPTS += -DNO_REGS
endif
utils/genapply/GenApply.hs : $(GHC_INCLUDE_DIR)/ghcconfig.h
utils/genapply/GenApply.hs : $(GHC_INCLUDE_DIR)/MachRegs.h
utils/genapply/GenApply.hs : $(GHC_INCLUDE_DIR)/Constants.h
utils/genapply/GenApply.hs : includes/ghcconfig.h
utils/genapply/GenApply.hs : includes/MachRegs.h
utils/genapply/GenApply.hs : includes/Constants.h
$(eval $(call build-prog,utils/genapply,dist,0))
......@@ -19,7 +19,7 @@ utils/hp2ps_dist_EXTRA_LIBRARIES = m
utils/hp2ps_dist_PROG = hp2ps$(exeext)
utils/hp2ps_dist_INSTALL = YES
utils/hp2ps_CC_OPTS += -Iincludes
utils/hp2ps_CC_OPTS += $(addprefix -I,$(GHC_INCLUDE_DIRS))
$(eval $(call build-prog,utils/hp2ps,dist,0))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment