Browse Source

Bugfix: Handle make dependencies on subdirectory files properly

Luke Dashjr 12 years ago
parent
commit
02acd0fdbe
1 changed files with 15 additions and 0 deletions
  1. 15 0
      Makefile.am

+ 15 - 0
Makefile.am

@@ -32,6 +32,14 @@ dist_rpcexamples_DATA = \
 
 SUBDIRS		= lib ccan
 
+# Without a redirected rule, code depending on different lib/*.h files may try to build dependencies of that in parallel, which can fail
+lib/%: lib_directory
+	@test -e $@
+lib_directory:
+	$(MAKE) -C lib
+ccan/libccan.a:
+	$(MAKE) -C ccan $*
+
 INCLUDES	= -fno-strict-aliasing
 
 bin_PROGRAMS	= bfgminer
@@ -67,6 +75,9 @@ dist_bitstreams_DATA =
 
 if NEED_LIBBLKMAKER
 SUBDIRS           += libblkmaker
+EXTRA_bfgminer_DEPENDENCIES += libblkmaker_directory
+libblkmaker_directory:
+	cd libblkmaker && $(MAKE)
 
 if HAVE_CYGWIN
 EXTRA_bfgminer_DEPENDENCIES += cygblkmaker-0.1-0.dll cygblkmaker_jansson-0.1-0.dll
@@ -127,9 +138,13 @@ if HAS_YASM
 AM_CFLAGS	= -DHAS_YASM
 if HAVE_x86_64
 SUBDIRS		+= x86_64
+x86_64/libx8664.a:
+	$(MAKE) -C x86_64 $*
 bfgminer_LDADD	+= x86_64/libx8664.a
 else # HAVE_x86_64
 SUBDIRS		+= x86_32
+x86_32/libx8632.a:
+	$(MAKE) -C x86_32 $*
 bfgminer_LDADD	+= x86_32/libx8632.a
 
 if HAVE_SSE2