fxconv now working and merged objects and assets_objects
This commit is contained in:
parent
946895c364
commit
3cc5abfde3
16
Makefile
16
Makefile
|
@ -20,8 +20,7 @@ CXXFLAGS = -Wall -Wextra -std=c++17 -O2 -I. -no-pie
|
||||||
LDFLAGS = -no-pie
|
LDFLAGS = -no-pie
|
||||||
|
|
||||||
# Deduce objects
|
# Deduce objects
|
||||||
OBJECTS = $(SOURCES:%.cpp=$(BUILD_DIR)/%.o)
|
OBJECTS = $(SOURCES:%.cpp=$(BUILD_DIR)/%.o) $(ASSETS:%=$(BUILD_DIR)/%.o)
|
||||||
ASSETS_OBJECTS = $(ASSETS:%=$(BUILD_DIR)/%.o)
|
|
||||||
|
|
||||||
# Verbose mode
|
# Verbose mode
|
||||||
ifeq ($(VERBOSE), 1)
|
ifeq ($(VERBOSE), 1)
|
||||||
|
@ -36,7 +35,7 @@ YELLOW := \033[1;33m
|
||||||
RESET := \033[0m
|
RESET := \033[0m
|
||||||
|
|
||||||
# Total number of files to process
|
# Total number of files to process
|
||||||
TOTAL_FILES := $(shell echo $$(($(words $(SOURCES))+1)))
|
TOTAL_FILES := $(shell echo $$(($(words $(SOURCES) $(ASSETS))+1)))
|
||||||
CURRENT_FILE := 0
|
CURRENT_FILE := 0
|
||||||
|
|
||||||
# Default targets
|
# Default targets
|
||||||
|
@ -44,12 +43,12 @@ all: build_dir $(OUTPUT) end
|
||||||
|
|
||||||
# Create build directory
|
# Create build directory
|
||||||
build_dir:
|
build_dir:
|
||||||
$(Q)mkdir -p $(dir $(OBJECTS)) $(dir $(ASSETS_OBJECTS))
|
$(Q)mkdir -p $(dir $(OBJECTS))
|
||||||
|
|
||||||
# Link target
|
# Link target
|
||||||
$(OUTPUT): $(OBJECTS) $(ASSETS_OBJECTS)
|
$(OUTPUT): $(OBJECTS)
|
||||||
@echo "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)"
|
@echo "[100%] $(YELLOW)Linking $(OUTPUT)$(RESET)"
|
||||||
$(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJECTS) $(ASSETS_OBJECTS)
|
$(Q)$(CXX) $(LDFLAGS) -o $@ $(OBJECTS)
|
||||||
|
|
||||||
# Build .o files from .cpp
|
# Build .o files from .cpp
|
||||||
$(BUILD_DIR)/%.o: %.cpp
|
$(BUILD_DIR)/%.o: %.cpp
|
||||||
|
@ -59,10 +58,9 @@ $(BUILD_DIR)/%.o: %.cpp
|
||||||
$(Q)mkdir -p $(dir $@)
|
$(Q)mkdir -p $(dir $@)
|
||||||
$(Q)$(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
|
$(Q)$(CXX) $(CXXFLAGS) -MMD -MP -c $< -o $@
|
||||||
|
|
||||||
# Convert .png.o from .png
|
# Convert .*.o from .* (png files for example)
|
||||||
$(BUILD_DIR)/%.o: %
|
$(BUILD_DIR)/%.o: %
|
||||||
#fxconv --cg --toolchain= --arch=x86-64 --outputtarget=elf64 $< -o $@
|
fxconv --cg --toolchain= --arch=x86-64 --outputtarget=elf64-x86-64 $< -o $@
|
||||||
fxconv --cg --toolchain=sh-elf $< -o $@
|
|
||||||
|
|
||||||
# Source files dependencies
|
# Source files dependencies
|
||||||
-include $(OBJECTS:.o=.d)
|
-include $(OBJECTS:.o=.d)
|
||||||
|
|
Loading…
Reference in New Issue