$(call package-config,$1,$2,$3)
+# Bootstrapping libs are only built one way
+ifeq "$3" "0"
+$1_$2_WAYS = v
+else
+$1_$2_WAYS = $$(GhcLibWays)
+endif
+
+# We must use a different dependency file if $(GhcLibWays) changes, so
+# encode the ways into the name of the file.
+$1_$2_WAYS_DASHED = $$(subst $$(space),,$$(patsubst %,-%,$$(strip $$($1_$2_WAYS))))
+$1_$2_depfile_base = $1/$2/build/.depend$$($1_$2_WAYS_DASHED)
+
########################################
ifeq "$$($1_$2_CONFIGURE_PHASE)" ""
$$(error No configure phase for $1_$2)
ifeq "$$(phase_$$($1_$2_CONFIGURE_PHASE)_done)" "YES"
-# Sometimes we need to modify the automatically-generated package-data.mk
-# bindings in a special way for the GHC build system, so allow that here:
-$($1_PACKAGE_MAGIC)
-
-# Bootstrapping libs are only built one way
-ifeq "$3" "0"
-$1_$2_WAYS = v
-else
-$1_$2_WAYS = $$(GhcLibWays)
-endif
-
$(call hs-sources,$1,$2)
$(call c-sources,$1,$2)
$(call includes-sources,$1,$2)
# --- DEPENDENCIES
-# We must use a different dependency file if $(GhcLibWays) changes, so
-# encode the ways into the name of the file.
-$1_$2_WAYS_DASHED = $$(subst $$(space),,$$(patsubst %,-%,$$(strip $$($1_$2_WAYS))))
-$1_$2_depfile_base = $1/$2/build/.depend$$($1_$2_WAYS_DASHED)
-
$(call build-dependencies,$1,$2,$3)
# --- BUILDING