Skip to content

Commit

Permalink
Update Makefiles for ExaequOS #23
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed May 21, 2024
1 parent 859cf0a commit 29278ee
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ build/
doc/coverage/
external/*/
src/*/VERSION.txt
exapkgs
pkg_list.json
.cache
.vscode/settings.json
TimedPetriNetEditor*.tar.gz

# LaTeX
*.aux
Expand Down
2 changes: 1 addition & 1 deletion .makefile
29 changes: 18 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,34 @@ 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

###################################################
# Embed assets for web version. Assets shall be
# 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.
Expand Down Expand Up @@ -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
Expand Down
18 changes: 14 additions & 4 deletions src/Editor/DearImGui/Makefile.imgui
Original file line number Diff line number Diff line change
Expand Up @@ -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

###################################################
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/julia/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 29278ee

Please sign in to comment.