diff --git a/Engine/core.c b/Engine/core.c new file mode 100644 index 0000000..8160250 --- /dev/null +++ b/Engine/core.c @@ -0,0 +1,26 @@ +/* +** EPITECH PROJECT, 2023 +** Title: Engine-3D +** Author: MasterLaplace +** Created: 2023-10-16 +** File description: +** core +*/ + +#include +#include + +#ifdef ENGINE_SYSTEM_WINDOWS +#include + +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { +#else +int main(int ac, const char *av[]) { +#endif + if (ac != 2) { + printf("Usage: ./engine.out [config.xml]\n"); + return EXIT_FAILURE; + } + printf("Loading config file: %s\n", av[1]); + return EXIT_SUCCESS; +} diff --git a/Makefile b/Makefile index 68eea40..ad73bf6 100644 --- a/Makefile +++ b/Makefile @@ -15,14 +15,13 @@ GRAPHICAL_LIB := $(word 3, $(MAKECMDGOALS)) DEFAULT_GRAPHICAL_LIB := csfml -SRC_DIR = ./Engine/ +SRC_DIR = Engine/ +BIN = bin/ -# SRC = $(shell find $(SRC_DIR) -name '*.c' | grep -v "core.c") MAIN = $(SRC_DIR)core.c -MAIN_OBJ = $(MAIN_SRC:.c=.o) +OBJ = $(MAIN:.c=.o) -BIN = bin/ INCLUDES = -iquote ./Libs/LaplaceLib/include -iquote ./Libs/LaplaceLink/include \ -iquote ./Libs/LaplaceMap/include -iquote ./Libs/LaplaceError/include \ @@ -107,13 +106,13 @@ $(PROJECT_NAME): $(GRAPHICAL_LIB): @$(ECHO) $(BOLD) $(LIGHT_BLUE) "Selected graphical library: $(GRAPHICAL_LIB) šŸŽ® !" $(DEFAULT) -$(NAME): print lib $(MAIN_OBJ) - @$(CC) -o $(NAME) ok.c \ +$(NAME): $(OBJ) + @$(CC) -o $(NAME) $(OBJ) $(CFLAGS) \ && $(ECHO) $(BOLD) $(GREEN)"\nā–ŗ BUILD SUCCESS ā›½ !"$(DEFAULT) \ || ($(ECHO) $(BOLD) $(RED)"\nā–ŗ BUILD FAILED ā›½"$(DEFAULT) && exit 1) -all: $(NAME) $(PROJECT_NAME) $(GRAPHICAL_LIB) +all: print lib $(NAME) $(PROJECT_NAME) $(GRAPHICAL_LIB) print: @$(ECHO) $(BOLD)$(GREEN)"šŸš€ Engine-3D šŸš€"$(DEFAULT) diff --git a/ok.c b/ok.c deleted file mode 100644 index 9d33109..0000000 --- a/ok.c +++ /dev/null @@ -1,11 +0,0 @@ -#include -#include - -int main(int ac, const char *av[]) { - if (ac != 2) { - printf("Usage: ./engine.out [config.xml]\n"); - return EXIT_FAILURE; - } - printf("Loading config file: %s\n", av[1]); - return EXIT_SUCCESS; -}