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:
parent
2aeae2aea9
commit
c127d16326
Notes:
sideshowbarker
2024-07-19 10:41:41 +09:00
Author: https://github.com/jcs Commit: https://github.com/SerenityOS/serenity/commit/c127d163267 Pull-request: https://github.com/SerenityOS/serenity/pull/914
47 changed files with 130 additions and 113 deletions
|
@ -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"`\"
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,6 +6,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Calculator
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -3,6 +3,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = SystemDialog
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,6 +6,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Taskbar
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -5,7 +5,7 @@ OBJS = \
|
|||
|
||||
PROGRAM = Welcome
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
.SUFFIXES: .png
|
||||
%.png.o: %.png
|
||||
|
|
|
@ -3,6 +3,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Fire
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -3,6 +3,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = HelloWorld
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -3,7 +3,7 @@ OBJS = \
|
|||
|
||||
PROGRAM = HelloWorld2
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Core
|
||||
|
||||
main.cpp: UI_HelloWorld2.h
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = WidgetGallery
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -18,6 +18,6 @@ OBJS = \
|
|||
|
||||
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
|
||||
|
|
|
@ -7,6 +7,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Inspector
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -6,6 +6,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = ProfileViewer
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -9,6 +9,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = VisualBuilder
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI Draw IPC Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -4,6 +4,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Minesweeper
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -4,6 +4,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Snake
|
||||
|
||||
LDFLAGS = -lgui -ldraw -lipc -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -4,6 +4,10 @@ OBJS = \
|
|||
|
||||
LIBRARY = libaudio.a
|
||||
|
||||
AClientConnection.cpp: ../../Servers/AudioServer/AudioClientEndpoint.h
|
||||
../../Servers/AudioServer/AudioClientEndpoint.h:
|
||||
@$(MAKE) -C $(dir $(@))
|
||||
|
||||
install:
|
||||
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/
|
||||
cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
.NOTPARALLEL:
|
||||
|
||||
AK_OBJS = \
|
||||
../../AK/StringImpl.o \
|
||||
../../AK/String.o \
|
||||
|
@ -59,19 +61,22 @@ OBJS = $(AK_OBJS) $(LIBC_OBJS)
|
|||
|
||||
EXTRA_OBJS = setjmp.ao crti.ao crtn.ao
|
||||
|
||||
.PHONY: startfiles
|
||||
startfiles: $(EXTRA_OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
|
||||
crt0.o: crt0.cpp
|
||||
$(QUIET) $(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
|
||||
|
||||
crtio.o: crti.ao
|
||||
$(QUIET) cp crti.ao crti.o
|
||||
|
||||
crtn.o: crtin.ao
|
||||
$(QUIET) cp crtn.ao crtn.o
|
||||
|
||||
EXTRA_CLEAN = crt0.d
|
||||
EXTRA_CLEAN = crt0.d crt0.o
|
||||
|
||||
DEFINES = -DSERENITY_LIBC_BUILD
|
||||
|
||||
LIBRARY = libc.a
|
||||
|
||||
all: $(LIBRARY) startfiles install
|
||||
all: crt0.o $(EXTRA_OBJS) $(LIBRARY) install
|
||||
|
||||
install:
|
||||
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/sys/
|
||||
|
|
|
@ -63,6 +63,11 @@ OBJS = \
|
|||
|
||||
LIBRARY = libgui.a
|
||||
|
||||
GWindowServerConnection.cpp: ../../Servers/WindowServer/WindowServerEndpoint.h
|
||||
|
||||
../../Servers/WindowServer/WindowServerEndpoint.h:
|
||||
@$(MAKE) -C $(dir $(@))
|
||||
|
||||
install:
|
||||
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/
|
||||
cp ./*.h $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/
|
||||
|
|
3
Libraries/LibHTML/CodeGenerators/Makefile
Normal file
3
Libraries/LibHTML/CodeGenerators/Makefile
Normal file
|
@ -0,0 +1,3 @@
|
|||
SUBDIRS := $(wildcard */.)
|
||||
|
||||
include ../../../Makefile.subdir
|
|
@ -67,17 +67,28 @@ EXTRA_SOURCES = \
|
|||
CSS/PropertyID.h \
|
||||
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
|
||||
@echo "GENERATE $@"
|
||||
$(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 $@"
|
||||
$(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 $@"
|
||||
$(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)
|
||||
|
||||
|
@ -91,3 +102,7 @@ install:
|
|||
cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
|
||||
|
||||
include ../../Makefile.common
|
||||
|
||||
SUBDIRS = CodeGenerators
|
||||
|
||||
include ../../Makefile.subdir
|
||||
|
|
41
Makefile
41
Makefile
|
@ -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 += \
|
||||
Libraries/LibC \
|
||||
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 \
|
||||
AK \
|
||||
Applications \
|
||||
DevTools \
|
||||
Kernel \
|
||||
Libraries \
|
||||
MenuApplets \
|
||||
Servers \
|
||||
Shell \
|
||||
Userland \
|
||||
MenuApplets \
|
||||
Demos \
|
||||
Userland
|
||||
|
||||
SUBDIRS += \
|
||||
Games \
|
||||
Kernel
|
||||
Demos
|
||||
|
||||
include Makefile.subdir
|
||||
|
||||
|
|
|
@ -20,22 +20,6 @@ INCLUDE_FLAGS += \
|
|||
-I$(SERENITY_BASE_DIR)/Libraries \
|
||||
-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
|
||||
|
||||
ifneq ($(HOST_CXX),)
|
||||
|
@ -56,26 +40,33 @@ else
|
|||
-I$(SERENITY_BASE_DIR)/Libraries/LibM \
|
||||
-I$(SERENITY_BASE_DIR)/Libraries/LibPthread
|
||||
|
||||
LDFLAGS += \
|
||||
-L$(SERENITY_BASE_DIR)/Libraries/LibC
|
||||
|
||||
ifdef KERNEL
|
||||
DEFINES += -DKERNEL
|
||||
else
|
||||
# everything else gets -lc -lm
|
||||
LIB_DEPS += C M
|
||||
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 ?=
|
||||
endif
|
||||
|
||||
#CXX = clang $(CLANG_FLAGS)
|
||||
#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)
|
||||
|
||||
DEFINES += -DSANITIZE_PTRS
|
||||
|
||||
IPCCOMPILER = $(SERENITY_BASE_DIR)/DevTools/IPCCompiler/IPCCompiler
|
||||
|
||||
SUFFIXED_OBJS = $(patsubst %.o,%$(OBJ_SUFFIX).o,$(OBJS))
|
||||
|
||||
ifeq ($(VERBOSE),1)
|
||||
|
@ -98,7 +89,7 @@ endif
|
|||
@echo "AS $@"
|
||||
$(QUIET) $(AS) -o $@ $<
|
||||
|
||||
$(PROGRAM): $(SUFFIXED_OBJS) $(EXTRA_OBJS)
|
||||
$(PROGRAM): $(SUFFIXED_OBJS) $(EXTRA_OBJS) $(STATIC_LIB_DEPS)
|
||||
@echo "LINK $(PROGRAM)"
|
||||
$(QUIET) $(CXX) -o $(PROGRAM) $(EXTRA_OBJS) $(SUFFIXED_OBJS) $(LDFLAGS)
|
||||
|
||||
|
@ -106,6 +97,19 @@ $(LIBRARY): $(SUFFIXED_OBJS) $(EXTRA_OBJS)
|
|||
@echo "LIB $@"
|
||||
$(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
|
||||
|
||||
all: $(PROGRAM) $(LIBRARY)
|
||||
|
@ -118,4 +122,6 @@ clean:
|
|||
|
||||
install:
|
||||
|
||||
.DELETE_ON_ERROR:
|
||||
|
||||
.PHONY: all clean install
|
||||
|
|
|
@ -2,6 +2,6 @@ OBJS = main.o
|
|||
|
||||
PROGRAM = Audio.MenuApplet
|
||||
|
||||
LDFLAGS = -laudio -lgui -lipc -ldraw -lthread -lpthread -lcore -lc
|
||||
LIB_DEPS = Audio GUI IPC Draw Thread Pthread Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -2,6 +2,6 @@ OBJS = main.o
|
|||
|
||||
PROGRAM = CPUGraph.MenuApplet
|
||||
|
||||
LDFLAGS = -laudio -lgui -lipc -ldraw -lthread -lpthread -lcore -lc
|
||||
LIB_DEPS = GUI IPC Draw Thread Pthread Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -6,16 +6,16 @@ OBJS = \
|
|||
|
||||
PROGRAM = AudioServer
|
||||
|
||||
LDFLAGS = -lc -lcore -lipc -lthread -lpthread
|
||||
LIB_DEPS = Core IPC Thread Pthread
|
||||
|
||||
EXTRA_CLEAN = AudioServerEndpoint.h AudioClientEndpoint.h
|
||||
|
||||
*.cpp: AudioServerEndpoint.h AudioClientEndpoint.h
|
||||
|
||||
AudioServerEndpoint.h: AudioServer.ipc
|
||||
AudioServerEndpoint.h: AudioServer.ipc IPCCOMPILER
|
||||
@echo "IPC $<"; $(IPCCOMPILER) $< > $@
|
||||
|
||||
AudioClientEndpoint.h: AudioClient.ipc
|
||||
AudioClientEndpoint.h: AudioClient.ipc IPCCOMPILER
|
||||
@echo "IPC $<"; $(IPCCOMPILER) $< > $@
|
||||
|
||||
install:
|
||||
|
|
|
@ -4,6 +4,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = LookupServer
|
||||
|
||||
LDFLAGS = -lc -lcore
|
||||
LIB_DEPS = Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -8,14 +8,14 @@ OBJS = \
|
|||
|
||||
PROGRAM = ProtocolServer
|
||||
|
||||
LDFLAGS = -lc -lcore -lipc
|
||||
LIB_DEPS = Core IPC
|
||||
|
||||
*.cpp: ProtocolServerEndpoint.h ProtocolClientEndpoint.h
|
||||
|
||||
ProtocolServerEndpoint.h: ProtocolServer.ipc
|
||||
ProtocolServerEndpoint.h: ProtocolServer.ipc IPCCOMPILER
|
||||
@echo "IPC $<"; $(IPCCOMPILER) $< > $@
|
||||
|
||||
ProtocolClientEndpoint.h: ProtocolClient.ipc
|
||||
ProtocolClientEndpoint.h: ProtocolClient.ipc IPCCOMPILER
|
||||
@echo "IPC $<"; $(IPCCOMPILER) $< > $@
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -4,7 +4,7 @@ OBJS = \
|
|||
|
||||
PROGRAM = SystemServer
|
||||
|
||||
LDFLAGS = -lcore -lc
|
||||
LIB_DEPS = Core
|
||||
|
||||
install:
|
||||
mkdir -p ../../Root/usr/include/SystemServer/
|
||||
|
|
|
@ -5,6 +5,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = TelnetServer
|
||||
|
||||
LDFLAGS = -lcore -lc
|
||||
LIB_DEPS = Core
|
||||
|
||||
include ../../Makefile.common
|
||||
|
|
|
@ -18,14 +18,14 @@ OBJS = \
|
|||
|
||||
PROGRAM = WindowServer
|
||||
|
||||
LDFLAGS = -lc -ldraw -lcore -lthread -lpthread -lipc
|
||||
LIB_DEPS = Draw Core Thread Pthread IPC
|
||||
|
||||
*.cpp: WindowServerEndpoint.h WindowClientEndpoint.h
|
||||
|
||||
WindowServerEndpoint.h: WindowServer.ipc
|
||||
WindowServerEndpoint.h: WindowServer.ipc IPCCOMPILER
|
||||
@echo "IPC $<"; $(IPCCOMPILER) $< > $@
|
||||
|
||||
WindowClientEndpoint.h: WindowClient.ipc
|
||||
WindowClientEndpoint.h: WindowClient.ipc IPCCOMPILER
|
||||
@echo "IPC $<"; $(IPCCOMPILER) $< > $@
|
||||
|
||||
EXTRA_CLEAN = WindowServerEndpoint.h WindowClientEndpoint.h
|
||||
|
|
|
@ -5,6 +5,6 @@ OBJS = \
|
|||
|
||||
PROGRAM = Shell
|
||||
|
||||
LDFLAGS = -lcore -lc
|
||||
LIB_DEPS = Core
|
||||
|
||||
include ../Makefile.common
|
||||
|
|
|
@ -4,7 +4,7 @@ APPS = ${SRCS:.cpp=}
|
|||
|
||||
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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue