Ajout de la librairie godot linux + ajout makefile

This commit is contained in:
Amaury
2020-05-01 12:48:15 +02:00
parent 02fec31edf
commit d1a22d4768
3 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,40 @@
CC = g++
C_FLAGS = -g -Wall -ggdb -fPIC -std=c++14 -Og -m64 -fopenmp
LDFLAGS = -shared
GODOT_PATH = ../GodoBinding/#Chemin des rsrc godot
EXPORT_LINUX_PATH = $(SRC_PATH)linux/#Chemin du rep linux
SRC_PATH = ./DungeonAndDemaonScript/#Chemin des src
OBJ_PATH = $(EXPORT_LINUX_PATH)obj/#Chemin de l'export des obj
#Nom des includes
INCLUDE_GODOT = -I$(GODOT_PATH)include -I$(GODOT_PATH)include/gen -I$(GODOT_PATH)include/core -I$(GODOT_PATH)godot_headers -static
LIB_GODOT = -L$(GODOT_PATH)lib -lgodot-cpp.linux.debug.64#Nom des libs
LIB_NAME = $(EXPORT_LINUX_PATH)bin/DungeonAndDeamon.so #Chemin de l'export de la lib
LIB_SRC_CPP = $(wildcard $(SRC_PATH)*.cpp)#Recuperation des src .cpp
LIB_OBJ = $(addprefix $(OBJ_PATH), $(notdir $(LIB_SRC_CPP:.cpp=.o)))#Recuperation des .obj
all: init $(LIB_NAME)
$(LIB_NAME): $(LIB_OBJ)
$(CC) $(LDFLAGS) $^ -o $@ $(LIB_GODOT)
$(OBJ_PATH)%.o: $(SRC_PATH)%.cpp
$(CC) $(C_FLAGS) -c $^ $(INCLUDE_GODOT) -o $@
clean:
rm $(LIB_NAME)
#Test de si fichier existe / Sinon création
init : ./bin ./obj
./bin :
test ! -d $(EXPORT_LINUX_PATH)bin && mkdir $(EXPORT_LINUX_PATH)bin
./obj :
test ! -d $(EXPORT_LINUX_PATH)obj && mkdir $(EXPORT_LINUX_PATH)obj
super-clean: clean
rm $(LIB_OBJ)