From 29278ee564021a7fa14613dd212470451c65211c Mon Sep 17 00:00:00 2001 From: Quentin Quadrat Date: Tue, 21 May 2024 01:19:56 +0200 Subject: [PATCH] Update Makefiles for ExaequOS #23 --- .gitignore | 5 +++++ .makefile | 2 +- Makefile | 29 ++++++++++++++++++----------- src/Editor/DearImGui/Makefile.imgui | 18 ++++++++++++++---- src/julia/Makefile | 4 ++++ 5 files changed, 42 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index a50f914..c4149c0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,11 @@ build/ doc/coverage/ external/*/ src/*/VERSION.txt +exapkgs +pkg_list.json +.cache +.vscode/settings.json +TimedPetriNetEditor*.tar.gz # LaTeX *.aux diff --git a/.makefile b/.makefile index e763ff6..07ac6fe 160000 --- a/.makefile +++ b/.makefile @@ -1 +1 @@ -Subproject commit e763ff67918c56b479a7eb240ff04dcdee899539 +Subproject commit 07ac6fe3a2b642d358d86ee007d26bf546d60e70 diff --git a/Makefile b/Makefile index e30ae12..1ecfd0d 100644 --- a/Makefile +++ b/Makefile @@ -20,16 +20,21 @@ include $(M)/Makefile.header # 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 + 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 else ifeq ($(ARCHI),Linux) -LINKER_FLAGS += -lGL -PKG_LIBS += --static glfw3 -else ifneq ($(ARCHI),Emscripten) -$(error Unknown architecture $(ARCHI) for OpenGL) + LINKER_FLAGS += -lGL + PKG_LIBS += --static glfw3 +else ifeq ($(ARCHI),Emscripten) + ifneq ($(EXAEQUOS),) + LINKER_FLAGS += -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2 -sFULL_ES3 + PKG_LIBS += exa-wayland --static glfw + endif +else + $(error Unknown architecture $(ARCHI) for OpenGL) endif ################################################### @@ -37,10 +42,12 @@ endif # present inside $(BUILD) folder. # ifeq ($(ARCHI),Emscripten) +ifeq ($(EXAEQUOS),) LINKER_FLAGS += --preload-file examples LINKER_FLAGS += --preload-file data LINKER_FLAGS += -s FORCE_FILESYSTEM=1 endif +endif ################################################### # Create a MacOS X bundle application. @@ -111,15 +118,15 @@ unit-tests: .PHONY: check check: unit-tests -ifeq ($(ARCHI),Linux) ################################################### # Install project. You need to be root. .PHONY: install install: $(TARGET) + @$(call INSTALL_BINARY) +ifeq ($(EXAEQUOS),) @$(MAKE) --no-print-directory -C src/Net install @$(MAKE) --no-print-directory -C src/Editor install @$(MAKE) --no-print-directory -C src/julia install - @$(call INSTALL_BINARY) @$(call INSTALL_DOCUMENTATION) @$(call INSTALL_PROJECT_HEADERS) endif diff --git a/src/Editor/DearImGui/Makefile.imgui b/src/Editor/DearImGui/Makefile.imgui index 3b89012..9ace05d 100644 --- a/src/Editor/DearImGui/Makefile.imgui +++ b/src/Editor/DearImGui/Makefile.imgui @@ -3,10 +3,17 @@ # using Raylib backend since GLFW3 is not compilable. # ifeq ($(ARCHI),Emscripten) -ifneq ($(DEAR_IMGUI_BACKEND),RayLib) -$(warning Force RayLib backend for compiling with Emscripten) -DEAR_IMGUI_BACKEND = RayLib -endif + ifneq ($(EXAEQUOS),) + ifneq ($(DEAR_IMGUI_BACKEND),GLFW3) + $(warning Force GLFW3 backend for compiling with ExaequOS) + DEAR_IMGUI_BACKEND = GLFW3 + endif + else + ifneq ($(DEAR_IMGUI_BACKEND),RayLib) + $(warning Force RayLib backend for compiling with Emscripten) + DEAR_IMGUI_BACKEND = RayLib + endif + endif endif ################################################### @@ -46,6 +53,9 @@ endif # Dear ImGui backends: OpenGL/GLFW3 # ifeq ($(DEAR_IMGUI_BACKEND),GLFW3) +ifneq ($(EXAEQUOS),) +PKG_LIBS += --static glfw +endif VPATH += $(P)/src/Editor/DearImGui/Backends/GLFW3 INCLUDES += -I$(P)/src/Editor/DearImGui/Backends/GLFW3 GUI_OBJS += imgui_impl_glfw.o imgui_impl_opengl3.o diff --git a/src/julia/Makefile b/src/julia/Makefile index 975d894..33fbc12 100644 --- a/src/julia/Makefile +++ b/src/julia/Makefile @@ -34,8 +34,12 @@ INCLUDES += -I$(P)/include -I$(P)/src -I$(P)/external # LIB_TPNE_CORE = $(abspath $(P)/src/Net/$(BUILD)/libtimedpetrinetcore.a) LIB_TPNE_GUI = $(abspath $(P)/src/Editor/$(BUILD)/libtimedpetrinetgui.a) +ifneq ($(EXAEQUOS),) +PKG_LIBS += --static glfw +else PKG_LIBS += --static glfw3 LINKER_FLAGS += -lGL +endif # WARNING: do not use += since we do not want to include twice libraylib.a THIRDPART_LIBS := $(LIB_TPNE_GUI) $(LIB_TPNE_CORE)