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
16 $1/package.conf.inplace : $1/package.conf.in $(GHC_PKG_INPLACE)
17 $$(CPP) $$(RAWCPP_FLAGS) -P \
19 $$($1_PACKAGE_CPP_OPTS) \
20 -x c -I$$(GHC_INCLUDE_DIR) $$< | \
21 grep -v '^#pragma GCC' | \
22 sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@
24 "$$(GHC_PKG_INPLACE)" update --force $$@
26 # This is actually a real file, but we need to recreate it on every
27 # "make install", so we declare it as phony
28 .PHONY: $1/package.conf.install
29 $1/package.conf.install:
30 $$(CPP) $$(RAWCPP_FLAGS) -P \
32 -DLIB_DIR='"$$(libdir)"' \
33 -DINCLUDE_DIR='"$$(libdir)/include"' \
34 $$($1_PACKAGE_CPP_OPTS) \
35 -x c -I$$(GHC_INCLUDE_DIR) $1/package.conf.in | \
36 grep -v '^#pragma GCC' | \
37 sed -e 's/""//g' -e 's/:[ ]*,/: /g' >$$@
39 distclean : clean_$1_package.conf
40 .PHONY: clean_$1_package.conf
41 clean_$1_package.conf :
42 "$$(RM)" $$(RM_OPTS) $1/package.conf.install $1/package.conf.inplace