Compiling and linking with no problems

This commit is contained in:
Ulysse Cura 2026-04-12 21:01:42 +02:00
parent ac15fa55dd
commit 3a951feb23
5 changed files with 5 additions and 11 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
build build
core/* core

7
.vscode/launch.json vendored
View File

@ -12,12 +12,7 @@
"args": [], "args": [],
"stopAtEntry": false, "stopAtEntry": false,
"cwd": "${fileDirname}", "cwd": "${fileDirname}",
"environment": [ "environment": [],
{
"name": "LD_LIBRARY_PATH",
"value": "${workspaceFolder}/build/"
}
],
"externalConsole": false, "externalConsole": false,
"MIMode": "gdb", "MIMode": "gdb",
"setupCommands": [ "setupCommands": [

View File

@ -42,5 +42,5 @@ clean:
# Run executable # Run executable
.PHONY: run .PHONY: run
run: run:
$(Q)LD_LIBRARY_PATH=$(shell pwd)/build/ ./$(BUILD_DIR)/$(SOURCE_OUTPUT) $(Q)./$(BUILD_DIR)/$(SOURCE_OUTPUT)

2
core

@ -1 +1 @@
Subproject commit 5232d446a5dec84ac1d023ff34c36afc34704718 Subproject commit 9282b15528fe93be763d46a02dbe255968c548d5

View File

@ -33,10 +33,9 @@ count_src_build:
$(eval export TOTAL_SRC_FILES := $(shell echo $$(($$(make -n $(SOURCE_OBJECTS) 2>/dev/null | grep -c "Building") + 1)))) $(eval export TOTAL_SRC_FILES := $(shell echo $$(($$(make -n $(SOURCE_OBJECTS) 2>/dev/null | grep -c "Building") + 1))))
# Link game target # Link game target
# The ignore unresolved symbols in shared libs is ugly but works if the core changes.
$(BUILD_DIR)/$(SOURCE_OUTPUT): $(SOURCE_OBJECTS) $(BUILD_DIR)/libCore.so $(BUILD_DIR)/$(SOURCE_OUTPUT): $(SOURCE_OBJECTS) $(BUILD_DIR)/libCore.so
@echo -e "[100%] $(YELLOW)Linking $(SOURCE_OUTPUT)$(RESET)" @echo -e "[100%] $(YELLOW)Linking $(SOURCE_OUTPUT)$(RESET)"
$(Q)$(SRC_CC) $(SRC_LDFLAGS) $(SOURCE_OBJECTS) -L./$(BUILD_DIR) -lCore -Wl,-unresolved-symbols=ignore-in-shared-libs -o $@ $(Q)$(SRC_CC) $(SOURCE_OBJECTS) -L./$(BUILD_DIR) $(SRC_LDFLAGS) -lCore -Wl,-rpath,$(BUILD_DIR) -o $@
# Build .o files # Build .o files
$(BUILD_DIR)/$(SOURCE_DIR)/%.o: $(SOURCE_DIR)/%.c $(BUILD_DIR)/$(SOURCE_DIR)/%.o: $(SOURCE_DIR)/%.c