From d7913dcc9f6f49fbea5c1eb5d182e3e73ac13434 Mon Sep 17 00:00:00 2001 From: Ulysse Cura Date: Wed, 6 May 2026 20:41:01 +0200 Subject: [PATCH] Changed the Makefile structure and tested if libtar is found. --- Makefile | 10 ---------- src/Makefile | 8 ++++---- src/asset_manager.c | 6 +++++- 3 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index d26e725..0000000 --- a/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -SHELL=/usr/bin/env bash - -CORE_LIB_DIR=lib -CORE_SRC_DIR=src - -# Build core steps -build_core: build_core_lib build_core_src - -include $(CORE_DIR)/$(CORE_LIB_DIR)/Makefile -include $(CORE_DIR)/$(CORE_SRC_DIR)/Makefile diff --git a/src/Makefile b/src/Makefile index 2710653..f551b97 100644 --- a/src/Makefile +++ b/src/Makefile @@ -9,18 +9,18 @@ CORE_SOURCES := \ # Compiler and flags CORE_CC = gcc -CORE_CFLAGS = -Wall -Wextra -std=c17 -fPIC -g -DASSET_FILE=$(ASSET_OUTPUT) -CORE_INCLUDE_DIRS = $(CORE_DIR)/$(CORE_SRC_DIR)/headers +CORE_CFLAGS = -Wall -Wextra -std=c17 -fPIC -g -DASSET_FILENAME=$(ASSET_OUTPUT) +CORE_INCLUDE_DIRS = $(CORE_DIR)/headers CORE_LDFLAGS = $(shell sdl2-config --cflags --libs) -lSDL2_image # Deduce objects -CORE_OBJECTS = $(CORE_SOURCES:%.c=$(BUILD_DIR)/$(CORE_DIR)/$(CORE_SRC_DIR)/%.o) +CORE_OBJECTS = $(CORE_SOURCES:%.c=$(BUILD_DIR)/$(CORE_DIR)/%.o) # Current file nb to process CURRENT_CORE_FILE := 0 # Build core target -build_core_src: core_setup count_core_build $(BUILD_DIR)/libCore.so core_end +build_core: core_setup count_core_build $(BUILD_DIR)/libCore.so core_end # Core build directories core_setup: diff --git a/src/asset_manager.c b/src/asset_manager.c index bf67791..c683475 100644 --- a/src/asset_manager.c +++ b/src/asset_manager.c @@ -1,6 +1,10 @@ #include "asset_manager.h" #include +#include #include "display.h" -#include "linked_list.h" + +#ifndef ASSET_FILENAME + #define ASSET_FILENAME "game.data" +#endif