Fixing some Makefile problems.
This commit is contained in:
parent
e15a26428f
commit
51d751b698
|
|
@ -30,9 +30,9 @@ Q := @
|
|||
endif
|
||||
|
||||
# Colors
|
||||
GREEN := \033[0;32m
|
||||
YELLOW := \033[1;33m
|
||||
RESET := \033[0m
|
||||
GREEN := \033[32m
|
||||
YELLOW := \033[33m
|
||||
RESET := \033[m
|
||||
|
||||
# Current file nb to process
|
||||
CURRENT_FILE := 0
|
||||
|
|
@ -46,14 +46,14 @@ build_dir:
|
|||
|
||||
# Link target
|
||||
$(OUTPUT): $(OBJECTS)
|
||||
@echo "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)"
|
||||
@echo -e "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)"
|
||||
$(Q)$(CC) $(LDFLAGS) -o $@ $(OBJECTS)
|
||||
|
||||
# Build .o files from .c
|
||||
$(BUILD_DIR)/%.o: %.c
|
||||
$(eval CURRENT_FILE := $(shell echo $$(($(CURRENT_FILE)+1))))
|
||||
$(eval PERCENTAGE := $(shell echo $$(($(CURRENT_FILE)*100/$(TOTAL_FILES)))))
|
||||
@echo "[$(PERCENTAGE)%] $(GREEN)Building C object $@$(RESET)"
|
||||
@echo -e "[$(PERCENTAGE)%] $(GREEN)Building C object $@$(RESET)"
|
||||
$(Q)$(CC) $(CCFLAGS) $(INCLUDE_DIRS:%=-I%) -MMD -MP -c $< -o $@
|
||||
|
||||
# Source files dependencies
|
||||
|
|
@ -73,5 +73,5 @@ clean:
|
|||
|
||||
# Run executable
|
||||
.PHONY: run
|
||||
run:
|
||||
run: all
|
||||
$(Q)./$(OUTPUT)
|
||||
|
|
|
|||
Loading…
Reference in New Issue