Fix parallel build
authorThiago Macieira <thiago.macieira@intel.com>
Fri, 5 Sep 2014 00:27:00 +0000 (17:27 -0700)
committerErich Keane <erich.keane@intel.com>
Thu, 11 Sep 2014 17:55:32 +0000 (10:55 -0700)
All the .o files must be compiled before we can create the .a library
from them. When compiling with a -j option (as low as -j4), often one or
two .o files would be missing from the resulting .a because they hadn't
finished compiling yet.

Change-Id: Ie7bc0ad489b8b0afecab3ec318f2784ee706ae12
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
csdk/makefile

index 8818000..185121e 100644 (file)
@@ -126,7 +126,7 @@ obj_build:
        # Output all *.o files to $(OBJ_DIR)/$(BUILD)
        $(foreach source,$(SOURCES), $(CC) $(CFLAGS) $(source) -o $(patsubst %.c, %.o, $(patsubst %, $(BUILD)/$(OBJ_DIR)/%, $(notdir $(source))));)
 
-liboctbstack.a:
+liboctbstack.a: obj_build
        @echo "Building $@" 
        # Unpackage libcoap.a to $(OBJ_DIR)/$(BUILD). The output objects from OCStack and OCCoap are already at this location
        @cd $(BUILD)/$(OBJ_DIR) && $(AR) -x $(LCOAP_DIR)/$(BUILD)/libcoap.a