1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:07:35 +00:00

Build: support library and generator dependencies

Instead of directly manipulating LDFLAGS, set LIB_DEPS in each
subdirectory Makefile listing the libraries needed for
building/linking such as "LIB_DEPS = Core GUI Draw IPC Core".

This adds each library as an -L and -l argument in LDFLAGS, but
also adds the library.a file as a link dependency on the current
$(PROGRAM).  This causes the given library to be (re)built before
linking the current $(PROGRAM), but will also re-link any binaries
depending on that library when it is modified, when running make
from the root directory.

Also turn generator tools like IPCCompiler into dependencies on the
files they generate, so they are built on-demand when a particular
directory needs them.

This all allows the root Makefile to just list directories and not
care about the order, as all of the dependency tracking will figure
it out.
This commit is contained in:
joshua stein 2019-12-24 20:36:04 -06:00 committed by Andreas Kling
parent 2aeae2aea9
commit c127d16326
47 changed files with 130 additions and 113 deletions

View file

@ -3,7 +3,7 @@ OBJS = \
PROGRAM = About
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
LIB_DEPS = GUI Draw IPC Core
DEFINES += -DGIT_COMMIT=\"`git rev-parse --short HEAD`\" -DGIT_BRANCH=\"`git rev-parse --abbrev-ref HEAD`\" -DGIT_CHANGES=\"`git diff-index --quiet HEAD -- && echo "tracked"|| echo "untracked"`\"

View file

@ -3,6 +3,10 @@ OBJS = \
PROGRAM = Browser
LDFLAGS = -lgui -lhtml -ldraw -lprotocol -lipc -lcore -lc
LIB_DEPS = GUI HTML Draw IPC Protocol Core
main.cpp: ../../Libraries/LibHTML/CSS/PropertyID.h
../../Libraries/LibHTML/CSS/PropertyID.h:
@$(MAKE) -C ../../Libraries/LibHTML
include ../../Makefile.common

View file

@ -6,6 +6,6 @@ OBJS = \
PROGRAM = Calculator
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
LIB_DEPS = GUI Draw IPC Core
include ../../Makefile.common

View file

@ -5,6 +5,6 @@ OBJS = \
PROGRAM = ChanViewer
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -4,6 +4,6 @@ OBJS = \
PROGRAM = DisplayProperties
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -6,6 +6,6 @@ OBJS = \
PROGRAM = FileManager
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -6,12 +6,12 @@ OBJS = \
PROGRAM = FontEditor
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
LIB_DEPS = GUI Draw Core IPC
FontEditor.cpp: UI_FontEditorBottom.h
UI_FontEditorBottom.h: FontEditorBottom.frm
../../DevTools/FormCompiler/FormCompiler $< > $@
UI_FontEditorBottom.h: FontEditorBottom.frm FORMCOMPILER
$(QUIET) $(FORMCOMPILER) $< > $@
EXTRA_CLEAN = UI_FontEditorBottom.h

View file

@ -7,6 +7,6 @@ OBJS = \
PROGRAM = Help
LDFLAGS = -lgui -lhtml -lmarkdown -ldraw -lipc -lprotocol -lthread -lpthread -lcore -lc
LIB_DEPS = GUI HTML Draw Markdown IPC Protocol Thread Pthread Core
include ../../Makefile.common

View file

@ -5,6 +5,6 @@ OBJS = \
PROGRAM = HexEditor
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -11,6 +11,6 @@ OBJS = \
PROGRAM = IRCClient
LDFLAGS = -lgui -lhtml -ldraw -lprotocol -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI HTML Draw Protocol IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -14,6 +14,6 @@ OBJS = \
PROGRAM = PaintBrush
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -4,6 +4,6 @@ OBJS = \
PROGRAM = Piano
LDFLAGS = -lgui -ldraw -laudio -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw Audio IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -4,6 +4,6 @@ OBJS = \
PROGRAM = QuickShow
LDFLAGS = -lgui -ldraw -lprotocol -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw Protocol IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -6,6 +6,6 @@ OBJS = \
PROGRAM = SoundPlayer
LDFLAGS = -lgui -ldraw -laudio -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw Audio IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -3,6 +3,6 @@ OBJS = \
PROGRAM = SystemDialog
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
LIB_DEPS = GUI Draw IPC Core
include ../../Makefile.common

View file

@ -12,6 +12,6 @@ OBJS = \
PROGRAM = SystemMonitor
LDFLAGS = -lgui -ldraw -lprotocol -lpcidb -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw Protocol PCIDB IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -6,6 +6,6 @@ OBJS = \
PROGRAM = Taskbar
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
LIB_DEPS = GUI Draw IPC Core
include ../../Makefile.common

View file

@ -3,6 +3,6 @@ OBJS = \
PROGRAM = Terminal
LDFLAGS = -lgui -ldraw -lvt -lprotocol -lipc -lcore -lc
LIB_DEPS = GUI Draw VT IPC Protocol Core
include ../../Makefile.common

View file

@ -4,6 +4,6 @@ OBJS = \
PROGRAM = TextEditor
LDFLAGS = -lgui -ldraw -lvt -lipc -lthread -lpthread -lcore -lc
LIB_DEPS = GUI Draw VT IPC Thread Pthread Core
include ../../Makefile.common

View file

@ -5,7 +5,7 @@ OBJS = \
PROGRAM = Welcome
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
LIB_DEPS = GUI Draw IPC Core
.SUFFIXES: .png
%.png.o: %.png