1 # -----------------------------------------------------------------------------
3 # (c) 2009 The University of Glasgow
5 # This file is part of the GHC build system.
7 # To understand how the build system works and how to modify it, see
8 # http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 # http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
11 # -----------------------------------------------------------------------------
14 define manual-package-config # args: $1 = dir
15 $(call trace, manual-package-config($1))
16 $(call profStart, manual-package-config($1))
18 $1/package.conf.inplace : $1/package.conf.in $(GHC_PKG_INPLACE)
19 $$(CPP) $$(RAWCPP_FLAGS) -P \
21 $$($1_PACKAGE_CPP_OPTS) \
22 -x c -I$$(GHC_INCLUDE_DIR) $$< -o $$@.raw
23 grep -v '^#pragma GCC' $$@.raw | \
24 sed -e 's/""//g' -e 's/:[ ]*,/: /g' > $$@
26 "$$(GHC_PKG_INPLACE)" update --force $$@
28 # This is actually a real file, but we need to recreate it on every
29 # "make install", so we declare it as phony
30 .PHONY: $1/package.conf.install
31 $1/package.conf.install:
32 $$(CPP) $$(RAWCPP_FLAGS) -P \
34 -DLIB_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))"' \
35 -DINCLUDE_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))/include"' \
36 $$($1_PACKAGE_CPP_OPTS) \
37 -x c -I$$(GHC_INCLUDE_DIR) $1/package.conf.in -o $$@.raw
38 grep -v '^#pragma GCC' $$@.raw | \
39 sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@
41 distclean : clean_$1_package.conf
42 .PHONY: clean_$1_package.conf
43 clean_$1_package.conf :
44 "$$(RM)" $$(RM_OPTS) $1/package.conf.install $1/package.conf.inplace
46 $(call profEnd, manual-package-config($1))