Fixed makefiles calls.
This commit is contained in:
parent
d562c7b339
commit
52b3240549
15
Makefile
15
Makefile
|
|
@ -4,11 +4,13 @@ SHELL = /usr/bin/env bash
|
|||
|
||||
ROOT := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
|
||||
|
||||
ifeq ($(filter clean-all,$(MAKECMDGOALS)),)
|
||||
ifneq ($(realpath $(ROOT)/config.mk), $(ROOT)/config.mk)
|
||||
$(error ERROR: Please run the configure script before building.)
|
||||
$(error ERROR: Please run the configure script before building)
|
||||
endif
|
||||
|
||||
include $(ROOT)/config.mk
|
||||
endif
|
||||
|
||||
#
|
||||
# User settings
|
||||
|
|
@ -65,14 +67,19 @@ RESET := \033[m
|
|||
# Default targets
|
||||
all: $(OUTPUT) $(ASSET_OUTPUT)
|
||||
|
||||
$(OUTPUT):
|
||||
$(OUTPUT): FORCE
|
||||
$(Q)cd $(SOURCE_DIR) && $(MAKE) $@
|
||||
|
||||
$(ASSET_OUTPUT):
|
||||
$(ASSET_OUTPUT): FORCE
|
||||
$(Q)cd $(ASSETS_DIR) && $(MAKE) $@
|
||||
|
||||
.PHONY: clean run print-var-%
|
||||
FORCE:
|
||||
|
||||
.PHONY: clean clean-all run print-var-%
|
||||
clean:
|
||||
$(Q)rm -rf $(BUILD_DIR)
|
||||
|
||||
clean-all:
|
||||
$(Q)rm -rf $(dir $(BUILD_DIR))
|
||||
|
||||
run: all
|
||||
|
|
|
|||
|
|
@ -26,5 +26,7 @@ $(BUILD_DIR)/$(notdir $(ASSETS_DIR))/%.o: $(ASSETS_DIR)/% $(ASSET_BUILDER_OUTPUT
|
|||
@echo -e "[$(PERCENTAGE)%] $(GREEN)Building ASSET object $@$(RESET)"
|
||||
$(Q)$(ASSET_BUILDER_OUTPUT) $@ -c $<
|
||||
|
||||
$(ASSET_BUILDER_OUTPUT):
|
||||
$(ASSET_BUILDER_OUTPUT): FORCE
|
||||
$(Q)cd $(ASSET_BUILDER_DIR) && $(MAKE) $@
|
||||
|
||||
FORCE:
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ done
|
|||
|
||||
## Clean
|
||||
if [ -n "${CLEAN}" ]; then
|
||||
make clean
|
||||
make clean-all
|
||||
rm -rf ${CONFIG_FILE}
|
||||
fi
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,9 @@ $(BUILD_DIR)/$(notdir $(SOURCE_DIR))/%.o: $(SOURCE_DIR)/%
|
|||
@echo -e "[$(PERCENTAGE)%] $(GREEN)Building C object $@$(RESET)"
|
||||
$(Q)$(TARGET_HOST_CC) $(TARGET_HOST_CFLAGS) $(INCLUDES:%=-I%) -MMD -MP -c $< -o $@
|
||||
|
||||
$(LIBCORE):
|
||||
$(LIBCORE): FORCE
|
||||
$(Q)cd $(CORE_DIR) && $(MAKE) $@
|
||||
|
||||
FORCE:
|
||||
|
||||
-include $(OBJECTS:.o=.d)
|
||||
|
|
|
|||
Loading…
Reference in New Issue