Skip to content

Commit

Permalink
feat(Engine): build core file of the Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterLaplace committed Oct 17, 2023
1 parent 01fccd2 commit 174a8f9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 18 deletions.
26 changes: 26 additions & 0 deletions Engine/core.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
** EPITECH PROJECT, 2023
** Title: Engine-3D
** Author: MasterLaplace
** Created: 2023-10-16
** File description:
** core
*/

#include <stdio.h>
#include <stdlib.h>

#ifdef ENGINE_SYSTEM_WINDOWS
#include <windows.h>

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;
}
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 0 additions & 11 deletions ok.c

This file was deleted.

0 comments on commit 174a8f9

Please sign in to comment.