Skip to content

Commit

Permalink
Fix project not recompiled when source of lib is modified
Browse files Browse the repository at this point in the history
  • Loading branch information
Lecrapouille committed May 1, 2024
1 parent a9c5f82 commit 5c4dec1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .makefile
46 changes: 16 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ include $(P)/Makefile.common
TARGET = $(PROJECT)
DESCRIPTION = Timed Petri Net Editor

###################################################
# Other targets
#
LIB_TPNE_CORE = $(abspath $(P)/src/Net/$(BUILD)/libtimedpetrinetcore.a)
LIB_TPNE_GUI = $(abspath $(P)/src/Editor/$(BUILD)/libtimedpetrinetgui.a)
LIB_TPNE_JULIA = $(abspath $(P)/src/julia/$(BUILD)/libtimedpetrinetjulia.a)

###################################################
# Sharable informations between all Makefiles
#
Expand Down Expand Up @@ -63,8 +56,6 @@ endif
# Stand-alone application.
#
include $(P)/src/Editor/DearImGui/Makefile.imgui
THIRDPART_LIBS += $(LIB_TPNE_GUI) $(LIB_TPNE_CORE)
THIRDPART_LIBS += $(LIB_TPNE_JULIA)
LINKER_FLAGS += -ldl -lpthread
VPATH += $(P)/include $(P)/src $(P)/src/Utils $(P)/src/Net
VPATH += $(P)/src/Net/Imports VPATH += $(P)/src/Net/Exports
Expand All @@ -74,31 +65,26 @@ OBJS += main.o
###################################################
# Compile the stand-alone application
.PHONY: all
all: | $(LIB_TPNE_GUI) $(LIB_TPNE_CORE) $(LIB_TPNE_JULIA)
all: $(TARGET) $(LIB_TPNE_GUI) $(LIB_TPNE_CORE) $(LIB_TPNE_JULIA) copy-emscripten-assets
all: $(TARGET) copy-emscripten-assets

###################################################
# Compile The Petri net core lib
$(LIB_TPNE_CORE): src/Net/Makefile Makefile
@$(call print-from,"Compiling Petri net core lib",$(PROJECT),core)
@$(MAKE) -C src/Net all
@cp $(LIB_TPNE_CORE) $(BUILD)
# Internal libraries
#
LIB_TPNE_CORE = $(abspath $(P)/$(BUILD)/libtimedpetrinetcore.a)
LIB_TPNE_GUI = $(abspath $(P)/$(BUILD)/libtimedpetrinetgui.a)
LIB_TPNE_JULIA = $(abspath $(P)/$(BUILD)/libtimedpetrinetjulia.a)
INTERNAL_LIBS += $(LIB_TPNE_GUI) $(LIB_TPNE_CORE) $(LIB_TPNE_JULIA)
DIRS_WITH_MAKEFILE := src/Editor src/Net src/julia

###################################################
# Compile The Petri net gui lib
$(LIB_TPNE_GUI): | $(LIB_TPNE_CORE)
$(LIB_TPNE_GUI): src/Editor/Makefile Makefile
@$(call print-from,"Compiling Petri net GUI lib",$(PROJECT),gui)
@$(MAKE) -C src/Editor all
@cp $(LIB_TPNE_GUI) $(BUILD)
$(LIB_TPNE_GUI): src/Editor

###################################################
# Compile interface for Julia
$(LIB_TPNE_JULIA): | $(LIB_TPNE_GUI)
$(LIB_TPNE_JULIA): $(LIB_TPNE_GUI) $(LIB_TPNE_CORE) src/julia/Makefile Makefile
@$(call print-from,"Compiling Interface for Julia-lang",$(PROJECT),Julia-lang)
@$(MAKE) -C src/julia all
@cp $(LIB_TPNE_JULIA) $(BUILD)
$(LIB_TPNE_CORE): src/Net

$(LIB_TPNE_JULIA): src/julia

src/julia: src/Editor

src/Editor: src/Net

###################################################
# Copy data inside BUILD to allow emscripten to embedded them
Expand Down
1 change: 1 addition & 0 deletions src/Editor/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
P := ../..
M := $(P)/.makefile
BUILD := $(P)/build

###################################################
# Project definition
Expand Down
1 change: 1 addition & 0 deletions src/Net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
P := ../..
M := $(P)/.makefile
BUILD := $(P)/build

###################################################
# Project definition
Expand Down
1 change: 1 addition & 0 deletions src/julia/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
P := ../..
M := $(P)/.makefile
BUILD := $(P)/build

###################################################
# Project definition
Expand Down

0 comments on commit 5c4dec1

Please sign in to comment.