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>
# 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