Skip to content

Commit

Permalink
Build: clean up build system, use one shared Makefile
Browse files Browse the repository at this point in the history
Allow everything to be built from the top level directory with just
'make', cleaned with 'make clean', and installed with 'make
install'.  Also support these in any particular subdirectory.

Specifying 'make VERBOSE=1' will print each ld/g++/etc. command as
it runs.

Kernel and early host tools (IPCCompiler, etc.) are built as
object.host.o so that they don't conflict with other things built
with the cross-compiler.
  • Loading branch information
jcs authored and awesomekling committed Dec 20, 2019
1 parent f4b2b72 commit ac25438
Show file tree
Hide file tree
Showing 92 changed files with 518 additions and 920 deletions.
5 changes: 5 additions & 0 deletions AK/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
install:
mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/AK/
cp ../AK/*.h $(SERENITY_BASE_DIR)/Root/usr/include/AK/

include ../Makefile.common
18 changes: 17 additions & 1 deletion AK/Tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,20 @@
PROGRAMS = TestBinarySearch TestAtomic TestString TestQueue TestVector TestHashMap TestJSON TestWeakPtr TestNonnullRefPtr TestRefPtr TestFixedArray TestFileSystemPath TestURL TestStringView TestUtf8 TestCircularQueue
PROGRAMS = \
TestBinarySearch \
TestAtomic \
TestString \
TestQueue \
TestVector \
TestHashMap \
TestJSON \
TestWeakPtr \
TestNonnullRefPtr \
TestRefPtr \
TestFixedArray \
TestFileSystemPath \
TestURL \
TestStringView \
TestUtf8 \
TestCircularQueue

CXXFLAGS = -std=c++17 -Wall -Wextra -ggdb3 -O2 -I../ -I../../

Expand Down
4 changes: 0 additions & 4 deletions AK/install.sh

This file was deleted.

8 changes: 4 additions & 4 deletions Applications/About/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include ../../Makefile.common

OBJS = \
main.o

APP = About
PROGRAM = About

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/Browser/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include ../../Makefile.common

OBJS = \
main.o

APP = Browser
PROGRAM = Browser

include ../Makefile.common
LDFLAGS = -lgui -lhtml -ldraw -lprotocol -lipc -lcore -lc

include ../../Makefile.common
16 changes: 8 additions & 8 deletions Applications/Calculator/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include ../../Makefile.common

OBJS = \
Calculator.o \
Keypad.o \
CalculatorWidget.o \
main.o
Calculator.o \
Keypad.o \
CalculatorWidget.o \
main.o

APP = Calculator
PROGRAM = Calculator

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/ChanViewer/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include ../../Makefile.common

OBJS = \
ThreadCatalogModel.o \
BoardListModel.o \
main.o

APP = ChanViewer
PROGRAM = ChanViewer

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/DisplayProperties/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include ../../Makefile.common

OBJS = \
DisplayProperties.o \
main.o \

APP = DisplayProperties
PROGRAM = DisplayProperties

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
10 changes: 5 additions & 5 deletions Applications/FileManager/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include ../../Makefile.common

OBJS = \
DirectoryView.o \
FileUtils.o \
PropertiesDialog.o \
PropertiesDialog.o \
main.o

APP = FileManager
PROGRAM = FileManager

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
9 changes: 5 additions & 4 deletions Applications/FontEditor/Makefile
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
include ../../Makefile.common

OBJS = \
FontEditor.o \
GlyphMapWidget.o \
GlyphEditorWidget.o \
main.o

APP = FontEditor
PROGRAM = FontEditor

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lcore -lc

FontEditor.cpp: UI_FontEditorBottom.h

UI_FontEditorBottom.h: FontEditorBottom.frm
../../DevTools/FormCompiler/FormCompiler $< > $@

EXTRA_CLEAN = UI_FontEditorBottom.h

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/Help/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
include ../../Makefile.common

OBJS = \
ManualModel.o \
ManualSectionNode.o \
ManualPageNode.o \
History.o \
main.o

APP = Help
PROGRAM = Help

include ../Makefile.common
LDFLAGS = -lgui -lhtml -lmarkdown -ldraw -lipc -lprotocol -lthread -lpthread -lcore -lc

include ../../Makefile.common
12 changes: 6 additions & 6 deletions Applications/HexEditor/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include ../../Makefile.common

OBJS = \
HexEditor.o \
HexEditor.o \
HexEditorWidget.o \
main.o
main.o

APP = HexEditor
PROGRAM = HexEditor

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/IRCClient/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include ../../Makefile.common

OBJS = \
IRCClient.o \
IRCChannel.o \
Expand All @@ -11,6 +9,8 @@ OBJS = \
IRCChannelMemberListModel.o \
main.o

APP = IRCClient
PROGRAM = IRCClient

include ../Makefile.common
LDFLAGS = -lgui -lhtml -ldraw -lprotocol -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
3 changes: 3 additions & 0 deletions Applications/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SUBDIRS := $(wildcard */.)

include ../Makefile.subdir
14 changes: 0 additions & 14 deletions Applications/Makefile.common

This file was deleted.

8 changes: 4 additions & 4 deletions Applications/PaintBrush/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include ../../Makefile.common

OBJS = \
PaintableWidget.o \
PaletteWidget.o \
Expand All @@ -14,6 +12,8 @@ OBJS = \
PickerTool.o \
main.o

APP = PaintBrush
PROGRAM = PaintBrush

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/Piano/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include ../../Makefile.common

OBJS = \
PianoWidget.o \
main.o

APP = Piano
PROGRAM = Piano

include ../Makefile.common
LDFLAGS = -lgui -ldraw -laudio -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/QuickShow/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include ../../Makefile.common

OBJS = \
QSWidget.o \
main.o

APP = QuickShow
PROGRAM = QuickShow

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lprotocol -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
12 changes: 6 additions & 6 deletions Applications/SoundPlayer/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include ../../Makefile.common

OBJS = \
PlaybackManager.o \
PlaybackManager.o \
SampleWidget.o \
SoundPlayerWidget.o \
SoundPlayerWidget.o \
main.o

APP = SoundPlayer
PROGRAM = SoundPlayer

include ../Makefile.common
LDFLAGS = -lgui -ldraw -laudio -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/SystemDialog/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include ../../Makefile.common

OBJS = \
main.o

APP = SystemDialog
PROGRAM = SystemDialog

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/SystemMonitor/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
include ../../Makefile.common

OBJS = \
ProcessModel.o \
DevicesModel.o \
Expand All @@ -12,6 +10,8 @@ OBJS = \
NetworkStatisticsWidget.o \
main.o

APP = SystemMonitor
PROGRAM = SystemMonitor

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lprotocol -lpcidb -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/Taskbar/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
include ../../Makefile.common

OBJS = \
TaskbarWindow.o \
TaskbarButton.o \
WindowList.o \
main.o

APP = Taskbar
PROGRAM = Taskbar

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lipc -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/Terminal/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include ../../Makefile.common

OBJS = \
main.o

APP = Terminal
PROGRAM = Terminal

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lvt -lprotocol -lipc -lcore -lc

include ../../Makefile.common
10 changes: 5 additions & 5 deletions Applications/TextEditor/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
include ../../Makefile.common

OBJS = \
TextEditorWidget.o \
main.o
main.o

APP = TextEditor
PROGRAM = TextEditor

include ../Makefile.common
LDFLAGS = -lgui -ldraw -lvt -lipc -lthread -lpthread -lcore -lc

include ../../Makefile.common
8 changes: 4 additions & 4 deletions Applications/Welcome/Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
include ../../Makefile.common

OBJS = \
main.o \
TextWidget.o \
background.png.o

APP = Welcome
PROGRAM = Welcome

LDFLAGS = -lgui -ldraw -lipc -lcore -lc

.SUFFIXES: .png
%.png.o: %.png
@echo "LINK $<"; $(LINK) --relocatable --format binary --output $@ $<

include ../Makefile.common
include ../../Makefile.common
20 changes: 3 additions & 17 deletions Demos/Fire/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,8 @@
include ../../Makefile.common

OBJS = \
Fire.o

APP = Fire

DEFINES += -DUSERLAND

all: $(APP)
PROGRAM = Fire

$(APP): $(OBJS)
$(LD) -o $(APP) $(LDFLAGS) $(OBJS) -lgui -ldraw -lipc -lcore -lc

.cpp.o:
@echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<

-include $(OBJS:%.o=%.d)

clean:
@echo "CLEAN"; rm -f $(APP) $(OBJS) *.d
LDFLAGS = -lgui -ldraw -lipc -lcore -lc

include ../../Makefile.common
Loading

0 comments on commit ac25438

Please sign in to comment.