From c127d1632679823d2cfe873895fad72aa52cfc87 Mon Sep 17 00:00:00 2001 From: joshua stein Date: Tue, 24 Dec 2019 20:36:04 -0600 Subject: 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. --- Applications/HexEditor/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Applications/HexEditor') diff --git a/Applications/HexEditor/Makefile b/Applications/HexEditor/Makefile index 2ce7c89bfe..690ee576f5 100644 --- a/Applications/HexEditor/Makefile +++ b/Applications/HexEditor/Makefile @@ -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 -- cgit v1.2.3