Fixed typo and added optional files for configuration in the GCC Project template
This commit is contained in:
parent
0d1e25433b
commit
0e02c38686
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Default",
|
||||||
|
"includePath": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 1
|
||||||
|
}
|
||||||
|
|
@ -6,9 +6,9 @@
|
||||||
"detail": "Build project",
|
"detail": "Build project",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "make",
|
"command": "make",
|
||||||
//"args": [
|
"args": [
|
||||||
// "-j$(nproc)"
|
"-j$(nproc)"
|
||||||
//],
|
],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"presentation": {
|
"presentation": {
|
||||||
"echo": true,
|
"echo": true,
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,13 @@ SOURCES := \
|
||||||
OUTPUT := GCC_Project
|
OUTPUT := GCC_Project
|
||||||
|
|
||||||
# Compiler and flags
|
# Compiler and flags
|
||||||
CXX = ccache gcc
|
CC = gcc
|
||||||
CXXFLAGS = -Wall -Wextra -std=c17 -g
|
CCFLAGS = -Wall -Wextra -std=c17
|
||||||
INCLUDE_DIRS =
|
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
|
|
||||||
|
# Include directories
|
||||||
|
INCLUDE_DIRS =
|
||||||
|
|
||||||
# Change output location
|
# Change output location
|
||||||
OUTPUT := $(BUILD_DIR)/$(OUTPUT)
|
OUTPUT := $(BUILD_DIR)/$(OUTPUT)
|
||||||
|
|
||||||
|
|
@ -45,14 +47,14 @@ build_dir:
|
||||||
# Link target
|
# Link target
|
||||||
$(OUTPUT): $(OBJECTS)
|
$(OUTPUT): $(OBJECTS)
|
||||||
@echo "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)"
|
@echo "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)"
|
||||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJECTS)
|
$(Q)$(CC) $(LDFLAGS) -o $@ $(OBJECTS)
|
||||||
|
|
||||||
# Build .o files from .c
|
# Build .o files from .c
|
||||||
$(BUILD_DIR)/%.o: %.c
|
$(BUILD_DIR)/%.o: %.c
|
||||||
$(eval CURRENT_FILE := $(shell echo $$(($(CURRENT_FILE)+1))))
|
$(eval CURRENT_FILE := $(shell echo $$(($(CURRENT_FILE)+1))))
|
||||||
$(eval PERCENTAGE := $(shell echo $$(($(CURRENT_FILE)*100/$(TOTAL_FILES)))))
|
$(eval PERCENTAGE := $(shell echo $$(($(CURRENT_FILE)*100/$(TOTAL_FILES)))))
|
||||||
@echo "[$(PERCENTAGE)%] $(GREEN)Building C object $@$(RESET)"
|
@echo "[$(PERCENTAGE)%] $(GREEN)Building C object $@$(RESET)"
|
||||||
$(Q)$(CXX) $(CXXFLAGS) $(INCLUDE_DIRS:%=-I%) -MMD -MP -c $< -o $@
|
$(Q)$(CC) $(CCFLAGS) $(INCLUDE_DIRS:%=-I%) -MMD -MP -c $< -o $@
|
||||||
|
|
||||||
# Source files dependencies
|
# Source files dependencies
|
||||||
-include $(OBJECTS:.o=.d)
|
-include $(OBJECTS:.o=.d)
|
||||||
|
|
@ -68,7 +70,6 @@ end: $(OUTPUT)
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
$(Q)rm -rf $(BUILD_DIR)
|
$(Q)rm -rf $(BUILD_DIR)
|
||||||
$(Q)rm -rf $(dir $(FXCONV_CONVERTERS))/__pycache__
|
|
||||||
|
|
||||||
# Run executable
|
# Run executable
|
||||||
.PHONY: run
|
.PHONY: run
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue