From 207b32ed973d1b16ed62d0c62c4c5d89d48a1751 Mon Sep 17 00:00:00 2001 From: Quentin Quadrat Date: Sat, 29 Jun 2024 17:15:07 +0200 Subject: [PATCH] Update Makefile fixing make install --- .makefile | 2 +- Makefile | 32 ++++++++++++++++++++++---- src/Editor/DearImGui/Backends/Makefile | 12 +++++++++- src/Editor/Makefile | 3 ++- src/julia/Makefile | 7 ++---- 5 files changed, 43 insertions(+), 13 deletions(-) diff --git a/.makefile b/.makefile index f50ad1e..937c117 160000 --- a/.makefile +++ b/.makefile @@ -1 +1 @@ -Subproject commit f50ad1e1887450afab1012535cb828ba1a664c29 +Subproject commit 937c1171b1be522d4051a3372c880b7ee1498ceb diff --git a/Makefile b/Makefile index ee2f4d3..31ff0ba 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ INCLUDES := $(P)/include VPATH := $(P)/src # Internal libs to compile LIB_TPNE_NET := $(call internal-lib,TimedPetriNet) -LIB_TPNE_EDITOR := $(call internal-lib,TimedPetriEditor) +LIB_TPNE_EDITOR := $(call internal-lib,TimedPetriGUI) LIB_TPNE_JULIA := $(call internal-lib,TimedPetriJulia) INTERNAL_LIBS := $(LIB_TPNE_EDITOR) $(LIB_TPNE_NET) $(LIB_TPNE_JULIA) DIRS_WITH_MAKEFILE := $(P)/src/Net $(P)/src/Editor $(P)/src/julia @@ -49,10 +49,6 @@ DIRS_WITH_MAKEFILE := $(P)/src/Net $(P)/src/Editor $(P)/src/julia # GUI # include $(abspath $(P)/src/Editor/DearImGui/Backends/Makefile) -THIRDPART_LIBS := -LINKER_FLAGS += -ldl -lpthread -INCLUDES += $(P)/src/Editor/DearImGui -INCLUDES += $(P)/src ################################################### # Embed assets for web version. Assets shall be @@ -70,6 +66,32 @@ ifeq ($(OS),Emscripten) endif endif +################################################### +# OpenGL: glfw and glew libraries +# +ifeq ($(ARCHI),Darwin) +INCLUDES += -I/usr/local/include -I/opt/local/include +LINKER_FLAGS += -framework OpenGL -framework Cocoa +LINKER_FLAGS += -framework IOKit -framework CoreVideo +LINKER_FLAGS += -L/usr/local/lib -L/opt/local/lib +LINKER_FLAGS += -lGLEW -lglfw +endif + +################################################### +# Project linker +# +LINKER_FLAGS += -ldl -lpthread + +################################################### +# MacOS X +# +ifeq ($(ARCHI),Darwin) +BUILD_MACOS_APP_BUNDLE = 1 +APPLE_IDENTIFIER = lecrapouille +MACOS_BUNDLE_ICON = data/TimedPetriNetEditor.icns +LINKER_FLAGS += -framework CoreFoundation +endif + ################################################### # Generic Makefile rules # diff --git a/src/Editor/DearImGui/Backends/Makefile b/src/Editor/DearImGui/Backends/Makefile index 761c0af..93ed7ec 100644 --- a/src/Editor/DearImGui/Backends/Makefile +++ b/src/Editor/DearImGui/Backends/Makefile @@ -80,7 +80,7 @@ ifeq ($(DEAR_IMGUI_BACKEND),RayLib) INCLUDES += $(THIRDPART_DIR)/rlImGui GUI_FILES += $(THIRDPART_DIR)/rlImGui/rlImGui.cpp INCLUDES += $(THIRDPART_DIR)/raylib/src - THIRDPART_LIBS += $(THIRDPART_DIR)/raylib/src/$(OS)/libraylib.a + GUI_THIRDPART_LIBS += $(THIRDPART_DIR)/raylib/src/$(OS)/libraylib.a ifeq ($(OS),Emscripten) ifdef EXAEQUOS LINKER_FLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 -sFULL_ES3 @@ -101,7 +101,9 @@ ifeq ($(DEAR_IMGUI_BACKEND),RayLib) USER_CXXFLAGS += -Wno-cast-qual -Wno-undef endif +################################################### # Dear ImGui +# INCLUDES += $(THIRDPART_DIR) INCLUDES += $(THIRDPART_DIR)/imgui GUI_FILES += $(THIRDPART_DIR)/imgui/imgui_widgets.cpp @@ -110,13 +112,21 @@ GUI_FILES += $(THIRDPART_DIR)/imgui/imgui_tables.cpp GUI_FILES += $(THIRDPART_DIR)/imgui/imgui.cpp GUI_FILES += $(THIRDPART_DIR)/imgui/misc/cpp/imgui_stdlib.cpp +################################################### # Dear ImGui plot +# GUI_FILES += $(THIRDPART_DIR)/implot/implot_items.cpp GUI_FILES += $(THIRDPART_DIR)/implot/implot.cpp +################################################### # Dear ImGui file dialog +# GUI_FILES += $(THIRDPART_DIR)/ImGuiFileDialog/ImGuiFileDialog.cpp USER_CXXFLAGS += -Wno-unknown-pragmas +################################################### # Petri Editor +# +INCLUDES += $(P)/src/Editor/DearImGui +INCLUDES += $(P)/src GUI_FILES += $(call wildcard,$(P)/src/Editor/DearImGui/*.cpp) \ No newline at end of file diff --git a/src/Editor/Makefile b/src/Editor/Makefile index 8c881d1..baaab18 100644 --- a/src/Editor/Makefile +++ b/src/Editor/Makefile @@ -28,7 +28,7 @@ M := $(P)/.makefile # Project definition # include $(P)/Makefile.common -TARGET_NAME := TimedPetriEditor +TARGET_NAME := TimedPetriGUI TARGET_DESCRIPTION := Library Editor for Petri nets include $(M)/project/Makefile @@ -42,6 +42,7 @@ include ./DearImGui/Backends/Makefile # INCLUDES += $(P)/src $(P)/include LIB_FILES += $(GUI_FILES) +THIRDPART_LIBS := $(GUI_THIRDPART_LIBS) ################################################### # Generic Makefile rules diff --git a/src/julia/Makefile b/src/julia/Makefile index e4479d5..d40a253 100644 --- a/src/julia/Makefile +++ b/src/julia/Makefile @@ -47,9 +47,9 @@ INCLUDES += $(P)/include $(P)/src # Internal libraries since we can call the GUI from Julia REPL # We force compilation order. LIB_TPNE_NET := $(call internal-lib,TimedPetriNet) -LIB_TPNE_EDITOR := $(call internal-lib,TimedPetriEditor) +LIB_TPNE_EDITOR := $(call internal-lib,TimedPetriGUI) INTERNAL_LIBS := $(LIB_TPNE_EDITOR) $(LIB_TPNE_NET) -DIRS_WITH_MAKEFILE := $(P)/src/Net $(P)/src/Editor +#DIRS_WITH_MAKEFILE := $(P)/src/Net $(P)/src/Editor #$(LIB_TPNE_NET): $(P)/src/Net @@ -68,9 +68,6 @@ USER_CXXFLAGS := -Wno-cast-qual -Wno-undef # GUI # include $(abspath $(P)/src/Editor/DearImGui/Backends/Makefile) -THIRDPART_LIBS := -INCLUDES += $(P)/src/Editor/DearImGui -INCLUDES += $(P)/src ################################################### # Generic Makefile rules