Skip to content

Commit

Permalink
Update Makefile fixing make install
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed Jun 30, 2024
1 parent 6578376 commit cfe017e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .makefile
32 changes: 27 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
#
Expand Down
12 changes: 11 additions & 1 deletion src/Editor/DearImGui/Backends/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
3 changes: 2 additions & 1 deletion src/Editor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/julia/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit cfe017e

Please sign in to comment.