diff --git a/Makefile b/Makefile index 2a42001..1de891d 100644 --- a/Makefile +++ b/Makefile @@ -20,8 +20,7 @@ CXXFLAGS = -Wall -Wextra -std=c++17 -O2 -I. -no-pie LDFLAGS = -no-pie # Deduce objects -OBJECTS = $(SOURCES:%.cpp=$(BUILD_DIR)/%.o) -ASSETS_OBJECTS = $(ASSETS:%=$(BUILD_DIR)/%.o) +OBJECTS = $(SOURCES:%.cpp=$(BUILD_DIR)/%.o) $(ASSETS:%=$(BUILD_DIR)/%.o) # Verbose mode ifeq ($(VERBOSE), 1) @@ -36,7 +35,7 @@ YELLOW := \033[1;33m RESET := \033[0m # Total number of files to process -TOTAL_FILES := $(shell echo $$(($(words $(SOURCES))+1))) +TOTAL_FILES := $(shell echo $$(($(words $(SOURCES) $(ASSETS))+1))) CURRENT_FILE := 0 # Default targets @@ -44,12 +43,12 @@ all: build_dir $(OUTPUT) end # Create build directory build_dir: - $(Q)mkdir -p $(dir $(OBJECTS)) $(dir $(ASSETS_OBJECTS)) + $(Q)mkdir -p $(dir $(OBJECTS)) # Link target -$(OUTPUT): $(OBJECTS) $(ASSETS_OBJECTS) +$(OUTPUT): $(OBJECTS) @echo "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)" - $(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(ASSETS_OBJECTS) + $(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJECTS) # Build .o files from .cpp $(BUILD_DIR)/%.o: %.cpp @@ -59,10 +58,9 @@ $(BUILD_DIR)/%.o: %.cpp $(Q)mkdir -p $(dir $@) $(Q)$(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@ -# Convert .png.o from .png +# Convert .*.o from .* (png files for example) $(BUILD_DIR)/%.o: % - #fxconv --cg --toolchain= --arch=x86-64 --outputtarget=elf64 $< -o $@ - fxconv --cg --toolchain=sh-elf $< -o $@ + fxconv --cg --toolchain= --arch=x86-64 --outputtarget=elf64-x86-64 $< -o $@ # Source files dependencies -include $(OBJECTS:.o=.d)