Small build system refactoring; no functional changes
authorIan Lynagh <ian@well-typed.com>
Thu, 21 Feb 2013 14:17:51 +0000 (14:17 +0000)
committerIan Lynagh <ian@well-typed.com>
Thu, 21 Feb 2013 14:17:51 +0000 (14:17 +0000)
rules/hs-suffix-rules-srcdir.mk
rules/hs-suffix-rules.mk

index 2a0480f..029ea0b 100644 (file)
@@ -50,8 +50,6 @@ $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.hs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP) $$(
 $1/$2/build/%.$$($3_hcsuf) : $1/$4/%.lhs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP) $$($1_$2_PKGDATA_DEP)
        $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -C $$< -o $$@
 
-$(call hi-rule,$1/$4,$1/$2/build,$3)
-
 # XXX: for some reason these get used in preference to the direct
 # .hs->.o rule, I don't know why --SDM
 
index 459ee37..5802591 100644 (file)
@@ -27,13 +27,15 @@ $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/autogen/%.hs $$(LAX_DEPS_FOLLOW) $$($1_
 $1/$2/build/%.$$($3_osuf) : $1/$2/build/autogen/%.hs $$(LAX_DEPS_FOLLOW) $$($1_$2_HC_DEP)
        $$(call cmd,$1_$2_HC) $$($1_$2_$3_ALL_HC_OPTS) -c $$< -o $$@
 
-$(call hi-rule,$1/$2/build,$1/$2/build,$3)
-$(call hi-rule,$1/$2/build/autogen,$1/$2/build,$3)
-
 endif
 
 $$(foreach dir,$$($1_$2_HS_SRC_DIRS),\
   $$(eval $$(call hs-suffix-rules-srcdir,$1,$2,$3,$$(dir))))
 
+$(call hi-rule,$1/$2/build,$1/$2/build,$3)
+$(call hi-rule,$1/$2/build/autogen,$1/$2/build,$3)
+$$(foreach dir,$$($1_$2_HS_SRC_DIRS),\
+  $$(eval $$(call hi-rule,$1/$$(dir),$1/$2/build,$3)))
+
 endef # hs-suffix-rules