1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21: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 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"`\" 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 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 include ../../Makefile.common

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -7,6 +7,6 @@ OBJS = \
PROGRAM = Help 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 include ../../Makefile.common

View file

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

View file

@ -11,6 +11,6 @@ OBJS = \
PROGRAM = IRCClient 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 include ../../Makefile.common

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -12,6 +12,6 @@ OBJS = \
PROGRAM = SystemMonitor 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 include ../../Makefile.common

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@ OBJS = \
PROGRAM = HelloWorld2 PROGRAM = HelloWorld2
LDFLAGS = -lgui -ldraw -lipc -lcore -lc LIB_DEPS = GUI IPC Draw Core
main.cpp: UI_HelloWorld2.h main.cpp: UI_HelloWorld2.h

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,6 +4,10 @@ OBJS = \
LIBRARY = libaudio.a LIBRARY = libaudio.a
AClientConnection.cpp: ../../Servers/AudioServer/AudioClientEndpoint.h
../../Servers/AudioServer/AudioClientEndpoint.h:
@$(MAKE) -C $(dir $(@))
install: install:
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/
cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/

View file

@ -1,3 +1,5 @@
.NOTPARALLEL:
AK_OBJS = \ AK_OBJS = \
../../AK/StringImpl.o \ ../../AK/StringImpl.o \
../../AK/String.o \ ../../AK/String.o \
@ -59,19 +61,22 @@ OBJS = $(AK_OBJS) $(LIBC_OBJS)
EXTRA_OBJS = setjmp.ao crti.ao crtn.ao EXTRA_OBJS = setjmp.ao crti.ao crtn.ao
.PHONY: startfiles crt0.o: crt0.cpp
startfiles: $(EXTRA_OBJS) $(QUIET) $(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
$(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
crtio.o: crti.ao
$(QUIET) cp crti.ao crti.o $(QUIET) cp crti.ao crti.o
crtn.o: crtin.ao
$(QUIET) cp crtn.ao crtn.o $(QUIET) cp crtn.ao crtn.o
EXTRA_CLEAN = crt0.d EXTRA_CLEAN = crt0.d crt0.o
DEFINES = -DSERENITY_LIBC_BUILD DEFINES = -DSERENITY_LIBC_BUILD
LIBRARY = libc.a LIBRARY = libc.a
all: $(LIBRARY) startfiles install all: crt0.o $(EXTRA_OBJS) $(LIBRARY) install
install: install:
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/sys/ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/sys/

View file

@ -63,6 +63,11 @@ OBJS = \
LIBRARY = libgui.a LIBRARY = libgui.a
GWindowServerConnection.cpp: ../../Servers/WindowServer/WindowServerEndpoint.h
../../Servers/WindowServer/WindowServerEndpoint.h:
@$(MAKE) -C $(dir $(@))
install: install:
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/
cp ./*.h $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/ cp ./*.h $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/

View file

@ -0,0 +1,3 @@
SUBDIRS := $(wildcard */.)
include ../../../Makefile.subdir

View file

@ -67,17 +67,28 @@ EXTRA_SOURCES = \
CSS/PropertyID.h \ CSS/PropertyID.h \
CSS/PropertyID.cpp CSS/PropertyID.cpp
GENERATE_CSS_PROPERTYID_CPP = CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp
GENERATE_CSS_PROPERTYID_H = CodeGenerators/Generate_CSS_PropertyID_h/Generate_CSS_PropertyID_h
$(GENERATE_CSS_PROPERTYID_H):
@$(MAKE) -C $(dir $(GENERATE_CSS_PROPERTYID_H))
$(GENERATE_CSS_PROPERTYID_CPP):
@$(MAKE) -C $(dir $(GENERATE_CSS_PROPERTYID_CPP))
CSS/DefaultStyleSheetSource.cpp: CSS/Default.css Scripts/GenerateStyleSheetSource.sh CSS/DefaultStyleSheetSource.cpp: CSS/Default.css Scripts/GenerateStyleSheetSource.sh
@echo "GENERATE $@" @echo "GENERATE $@"
$(QUIET) Scripts/GenerateStyleSheetSource.sh default_stylesheet_source $< > $@ $(QUIET) Scripts/GenerateStyleSheetSource.sh default_stylesheet_source $< > $@
CSS/PropertyID.h: CSS/Properties.json CodeGenerators/Generate_CSS_PropertyID_h/Generate_CSS_PropertyID_h.cpp CSS/PropertyID.h: CSS/Properties.json $(GENERATE_CSS_PROPERTYID_H)
@echo "GENERATE $@" @echo "GENERATE $@"
$(QUIET) CodeGenerators/Generate_CSS_PropertyID_h/Generate_CSS_PropertyID_h $< > $@ $(QUIET) $(GENERATE_CSS_PROPERTYID_H) $< > $@
CSS/PropertyID.cpp: CSS/Properties.json CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp.cpp CSS/PropertyID.cpp: CSS/Properties.json $(GENERATE_CSS_PROPERTYID_CPP)
@echo "GENERATE $@" @echo "GENERATE $@"
$(QUIET) CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp $< > $@ $(QUIET) $(GENERATE_CSS_PROPERTYID_CPP) $< > $@
EXTRA_CLEAN = CSS/DefaultStyleSheetSource.cpp CSS/PropertyID.h CSS/PropertyID.cpp
OBJS = $(EXTRA_OBJS) $(LIBHTML_OBJS) OBJS = $(EXTRA_OBJS) $(LIBHTML_OBJS)
@ -91,3 +102,7 @@ install:
cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
include ../../Makefile.common include ../../Makefile.common
SUBDIRS = CodeGenerators
include ../../Makefile.subdir

View file

@ -1,42 +1,17 @@
# Build the host-side tools first, since they are needed to build some programs.
SUBDIRS = \
DevTools/IPCCompiler \
DevTools/FormCompiler \
Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_cpp \
Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_h
# Build some libraries before IPC servers, since they depend on them.
SUBDIRS += \ SUBDIRS += \
Libraries/LibC \ AK \
Libraries/LibM \
Libraries/LibCore \
Libraries/LibDraw \
Libraries/LibIPC \
Libraries/LibThread \
Libraries/LibPthread
# Build IPC servers before their client code to ensure the IPC definitions are available.
SUBDIRS += \
Servers/AudioServer \
Servers/LookupServer \
Servers/ProtocolServer \
Libraries/LibAudio \
Servers/WindowServer
SUBDIRS += \
AK
SUBDIRS += \
Libraries \
Applications \ Applications \
DevTools \ DevTools \
Kernel \
Libraries \
MenuApplets \
Servers \ Servers \
Shell \ Shell \
Userland \ Userland
MenuApplets \
Demos \ SUBDIRS += \
Games \ Games \
Kernel Demos
include Makefile.subdir include Makefile.subdir

View file

@ -20,22 +20,6 @@ INCLUDE_FLAGS += \
-I$(SERENITY_BASE_DIR)/Libraries \ -I$(SERENITY_BASE_DIR)/Libraries \
-I$(SERENITY_BASE_DIR)/Servers -I$(SERENITY_BASE_DIR)/Servers
LDFLAGS += \
-L$(SERENITY_BASE_DIR)/Libraries/LibC \
-L$(SERENITY_BASE_DIR)/Libraries/LibPthread \
-L$(SERENITY_BASE_DIR)/Libraries/LibCore \
-L$(SERENITY_BASE_DIR)/Libraries/LibIPC \
-L$(SERENITY_BASE_DIR)/Libraries/LibM \
-L$(SERENITY_BASE_DIR)/Libraries/LibDraw \
-L$(SERENITY_BASE_DIR)/Libraries/LibGUI \
-L$(SERENITY_BASE_DIR)/Libraries/LibHTML \
-L$(SERENITY_BASE_DIR)/Libraries/LibMarkdown \
-L$(SERENITY_BASE_DIR)/Libraries/LibThread \
-L$(SERENITY_BASE_DIR)/Libraries/LibVT \
-L$(SERENITY_BASE_DIR)/Libraries/LibPCIDB \
-L$(SERENITY_BASE_DIR)/Libraries/LibProtocol \
-L$(SERENITY_BASE_DIR)/Libraries/LibAudio
VERBOSE = 0 VERBOSE = 0
ifneq ($(HOST_CXX),) ifneq ($(HOST_CXX),)
@ -56,26 +40,33 @@ else
-I$(SERENITY_BASE_DIR)/Libraries/LibM \ -I$(SERENITY_BASE_DIR)/Libraries/LibM \
-I$(SERENITY_BASE_DIR)/Libraries/LibPthread -I$(SERENITY_BASE_DIR)/Libraries/LibPthread
LDFLAGS += \
-L$(SERENITY_BASE_DIR)/Libraries/LibC
ifdef KERNEL ifdef KERNEL
DEFINES += -DKERNEL DEFINES += -DKERNEL
else
# everything else gets -lc -lm
LIB_DEPS += C M
endif endif
# turn "LIB_DEPS=C Core Thread" into "-lc -lcore -lthread -L.../LibC ..."
LDFLAGS += $(foreach lib,$(LIB_DEPS),\
-l$(shell echo $(lib) | tr A-Z a-z))
LDFLAGS += $(foreach lib,$(LIB_DEPS),\
-L$(SERENITY_BASE_DIR)/Libraries/Lib$(lib))
STATIC_LIB_DEPS = $(foreach lib,$(LIB_DEPS),\
$(SERENITY_BASE_DIR)/Libraries/Lib$(lib)/lib$(shell echo $(lib) | tr A-Z a-z).a)
OBJ_SUFFIX ?= OBJ_SUFFIX ?=
endif endif
#CXX = clang $(CLANG_FLAGS) #CXX = clang $(CLANG_FLAGS)
#CLANG_FLAGS = -Wconsumed -m32 -ffreestanding -march=i686 #CLANG_FLAGS = -Wconsumed -m32 -ffreestanding -march=i686
CXXFLAGS = -MMD -MP $(CXX_WARNING_FLAGS) $(CXX_OPTIMIZATION_FLAGS) $(CXX_FLAVOR_FLAGS) $(ARCH_FLAGS) $(CXX_STANDARD_FLAGS) $(CXX_SUGGEST_FLAGS) $(INCLUDE_FLAGS) $(DEFINES) $(SUBPROJECT_CXXFLAGS) CXXFLAGS = -MMD -MP $(CXX_WARNING_FLAGS) $(OPTIMIZATION_FLAGS) $(CXX_FLAVOR_FLAGS) $(ARCH_FLAGS) $(CXX_STANDARD_FLAGS) $(CXX_SUGGEST_FLAGS) $(INCLUDE_FLAGS) $(DEFINES) $(SUBPROJECT_CXXFLAGS)
CFLAGS = -MMD -MP $(C_FLAVOR_FLAGS) $(ARCH_FLAGS) $(C_STANDARD_FLAGS) $(C_SUGGEST_FLAGS) $(INCLUDE_FLAGS) $(DEFINES) $(SUBPROJECT_CXXFLAGS) CFLAGS = -MMD -MP $(C_FLAVOR_FLAGS) $(ARCH_FLAGS) $(C_STANDARD_FLAGS) $(C_SUGGEST_FLAGS) $(INCLUDE_FLAGS) $(DEFINES) $(SUBPROJECT_CXXFLAGS)
DEFINES += -DSANITIZE_PTRS DEFINES += -DSANITIZE_PTRS
IPCCOMPILER = $(SERENITY_BASE_DIR)/DevTools/IPCCompiler/IPCCompiler
SUFFIXED_OBJS = $(patsubst %.o,%$(OBJ_SUFFIX).o,$(OBJS)) SUFFIXED_OBJS = $(patsubst %.o,%$(OBJ_SUFFIX).o,$(OBJS))
ifeq ($(VERBOSE),1) ifeq ($(VERBOSE),1)
@ -98,7 +89,7 @@ endif
@echo "AS $@" @echo "AS $@"
$(QUIET) $(AS) -o $@ $< $(QUIET) $(AS) -o $@ $<
$(PROGRAM): $(SUFFIXED_OBJS) $(EXTRA_OBJS) $(PROGRAM): $(SUFFIXED_OBJS) $(EXTRA_OBJS) $(STATIC_LIB_DEPS)
@echo "LINK $(PROGRAM)" @echo "LINK $(PROGRAM)"
$(QUIET) $(CXX) -o $(PROGRAM) $(EXTRA_OBJS) $(SUFFIXED_OBJS) $(LDFLAGS) $(QUIET) $(CXX) -o $(PROGRAM) $(EXTRA_OBJS) $(SUFFIXED_OBJS) $(LDFLAGS)
@ -106,6 +97,19 @@ $(LIBRARY): $(SUFFIXED_OBJS) $(EXTRA_OBJS)
@echo "LIB $@" @echo "LIB $@"
$(QUIET) $(AR) rcs $@ $(OBJS) $(EXTRA_OBJS) $(LIBS) $(QUIET) $(AR) rcs $@ $(OBJS) $(EXTRA_OBJS) $(LIBS)
$(STATIC_LIB_DEPS):
@$(MAKE) -C $(dir $(@))
IPCCOMPILER = $(SERENITY_BASE_DIR)/DevTools/IPCCompiler/IPCCompiler
IPCCOMPILER: $(IPCCOMPILER)
$(IPCCOMPILER):
@$(MAKE) -C $(dir $(@))
FORMCOMPILER = $(SERENITY_BASE_DIR)/DevTools/FormCompiler/FormCompiler
FORMCOMPILER: $(FORMCOMPILER)
$(FORMCOMPILER):
@$(MAKE) -C $(dir $(@))
.DEFAULT_GOAL := all .DEFAULT_GOAL := all
all: $(PROGRAM) $(LIBRARY) all: $(PROGRAM) $(LIBRARY)
@ -118,4 +122,6 @@ clean:
install: install:
.DELETE_ON_ERROR:
.PHONY: all clean install .PHONY: all clean install

View file

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

View file

@ -2,6 +2,6 @@ OBJS = main.o
PROGRAM = CPUGraph.MenuApplet PROGRAM = CPUGraph.MenuApplet
LDFLAGS = -laudio -lgui -lipc -ldraw -lthread -lpthread -lcore -lc LIB_DEPS = GUI IPC Draw Thread Pthread Core
include ../../Makefile.common include ../../Makefile.common

View file

@ -6,16 +6,16 @@ OBJS = \
PROGRAM = AudioServer PROGRAM = AudioServer
LDFLAGS = -lc -lcore -lipc -lthread -lpthread LIB_DEPS = Core IPC Thread Pthread
EXTRA_CLEAN = AudioServerEndpoint.h AudioClientEndpoint.h EXTRA_CLEAN = AudioServerEndpoint.h AudioClientEndpoint.h
*.cpp: AudioServerEndpoint.h AudioClientEndpoint.h *.cpp: AudioServerEndpoint.h AudioClientEndpoint.h
AudioServerEndpoint.h: AudioServer.ipc AudioServerEndpoint.h: AudioServer.ipc IPCCOMPILER
@echo "IPC $<"; $(IPCCOMPILER) $< > $@ @echo "IPC $<"; $(IPCCOMPILER) $< > $@
AudioClientEndpoint.h: AudioClient.ipc AudioClientEndpoint.h: AudioClient.ipc IPCCOMPILER
@echo "IPC $<"; $(IPCCOMPILER) $< > $@ @echo "IPC $<"; $(IPCCOMPILER) $< > $@
install: install:

View file

@ -4,6 +4,6 @@ OBJS = \
PROGRAM = LookupServer PROGRAM = LookupServer
LDFLAGS = -lc -lcore LIB_DEPS = Core
include ../../Makefile.common include ../../Makefile.common

View file

@ -8,14 +8,14 @@ OBJS = \
PROGRAM = ProtocolServer PROGRAM = ProtocolServer
LDFLAGS = -lc -lcore -lipc LIB_DEPS = Core IPC
*.cpp: ProtocolServerEndpoint.h ProtocolClientEndpoint.h *.cpp: ProtocolServerEndpoint.h ProtocolClientEndpoint.h
ProtocolServerEndpoint.h: ProtocolServer.ipc ProtocolServerEndpoint.h: ProtocolServer.ipc IPCCOMPILER
@echo "IPC $<"; $(IPCCOMPILER) $< > $@ @echo "IPC $<"; $(IPCCOMPILER) $< > $@
ProtocolClientEndpoint.h: ProtocolClient.ipc ProtocolClientEndpoint.h: ProtocolClient.ipc IPCCOMPILER
@echo "IPC $<"; $(IPCCOMPILER) $< > $@ @echo "IPC $<"; $(IPCCOMPILER) $< > $@
include ../../Makefile.common include ../../Makefile.common

View file

@ -4,7 +4,7 @@ OBJS = \
PROGRAM = SystemServer PROGRAM = SystemServer
LDFLAGS = -lcore -lc LIB_DEPS = Core
install: install:
mkdir -p ../../Root/usr/include/SystemServer/ mkdir -p ../../Root/usr/include/SystemServer/

View file

@ -5,6 +5,6 @@ OBJS = \
PROGRAM = TelnetServer PROGRAM = TelnetServer
LDFLAGS = -lcore -lc LIB_DEPS = Core
include ../../Makefile.common include ../../Makefile.common

View file

@ -18,14 +18,14 @@ OBJS = \
PROGRAM = WindowServer PROGRAM = WindowServer
LDFLAGS = -lc -ldraw -lcore -lthread -lpthread -lipc LIB_DEPS = Draw Core Thread Pthread IPC
*.cpp: WindowServerEndpoint.h WindowClientEndpoint.h *.cpp: WindowServerEndpoint.h WindowClientEndpoint.h
WindowServerEndpoint.h: WindowServer.ipc WindowServerEndpoint.h: WindowServer.ipc IPCCOMPILER
@echo "IPC $<"; $(IPCCOMPILER) $< > $@ @echo "IPC $<"; $(IPCCOMPILER) $< > $@
WindowClientEndpoint.h: WindowClient.ipc WindowClientEndpoint.h: WindowClient.ipc IPCCOMPILER
@echo "IPC $<"; $(IPCCOMPILER) $< > $@ @echo "IPC $<"; $(IPCCOMPILER) $< > $@
EXTRA_CLEAN = WindowServerEndpoint.h WindowClientEndpoint.h EXTRA_CLEAN = WindowServerEndpoint.h WindowClientEndpoint.h

View file

@ -5,6 +5,6 @@ OBJS = \
PROGRAM = Shell PROGRAM = Shell
LDFLAGS = -lcore -lc LIB_DEPS = Core
include ../Makefile.common include ../Makefile.common

View file

@ -4,7 +4,7 @@ APPS = ${SRCS:.cpp=}
EXTRA_CLEAN = $(APPS) EXTRA_CLEAN = $(APPS)
LDFLAGS = -lc -lhtml -lgui -ldraw -laudio -lipc -lthread -lcore -lpcidb -lmarkdown -lpthread -lprotocol -lipc LIB_DEPS = HTML GUI Draw Audio Protocol IPC Thread Pthread Core PCIDB Markdown
all: $(OBJS) $(APPS) all: $(OBJS) $(APPS)