summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorjoshua stein <jcs@jcs.org>2019-12-18 17:35:46 -0600
committerAndreas Kling <awesomekling@gmail.com>2019-12-20 20:20:54 +0100
commitac25438d54252d70de0002e4cca04ac258967c47 (patch)
tree61b97be561fbb395b8aa3f84135ba7400dfb38e5 /Libraries
parentf4b2b72c8efc0f6d018b199a8cc95091e7cf4c3e (diff)
downloadserenity-ac25438d54252d70de0002e4cca04ac258967c47.zip
Build: clean up build system, use one shared Makefile
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.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibAudio/Makefile19
-rwxr-xr-xLibraries/LibAudio/install.sh8
-rw-r--r--Libraries/LibC/Makefile47
-rwxr-xr-xLibraries/LibC/install.sh19
-rw-r--r--Libraries/LibCore/Makefile19
-rwxr-xr-xLibraries/LibCore/install.sh8
-rw-r--r--Libraries/LibDraw/Makefile19
-rwxr-xr-xLibraries/LibDraw/install.sh8
-rw-r--r--Libraries/LibELF/Makefile1
-rw-r--r--Libraries/LibGUI/Makefile19
-rwxr-xr-xLibraries/LibGUI/install.sh8
-rw-r--r--Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_cpp/Makefile47
-rw-r--r--Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_h/Makefile47
-rw-r--r--Libraries/LibHTML/Makefile39
-rwxr-xr-xLibraries/LibHTML/install.sh11
-rw-r--r--Libraries/LibIPC/Makefile19
-rwxr-xr-xLibraries/LibIPC/install.sh8
-rw-r--r--Libraries/LibM/Makefile20
-rwxr-xr-xLibraries/LibM/install.sh9
-rw-r--r--Libraries/LibMarkdown/Makefile29
-rwxr-xr-xLibraries/LibMarkdown/install.sh8
-rw-r--r--Libraries/LibPCIDB/Makefile19
-rwxr-xr-xLibraries/LibPCIDB/install.sh8
-rw-r--r--Libraries/LibProtocol/Makefile16
-rw-r--r--Libraries/LibPthread/Makefile19
-rwxr-xr-xLibraries/LibPthread/install.sh9
-rw-r--r--Libraries/LibThread/Makefile19
-rwxr-xr-xLibraries/LibThread/install.sh8
-rw-r--r--Libraries/LibVT/Makefile16
-rw-r--r--Libraries/Makefile3
30 files changed, 142 insertions, 387 deletions
diff --git a/Libraries/LibAudio/Makefile b/Libraries/LibAudio/Makefile
index de13688258..aad4b7122d 100644
--- a/Libraries/LibAudio/Makefile
+++ b/Libraries/LibAudio/Makefile
@@ -1,21 +1,12 @@
-include ../../Makefile.common
-
OBJS = \
AClientConnection.o \
AWavLoader.o
LIBRARY = libaudio.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibAudio/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibAudio/install.sh b/Libraries/LibAudio/install.sh
deleted file mode 100755
index 2cc86acbed..0000000000
--- a/Libraries/LibAudio/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibAudio/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibAudio/
-cp libaudio.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibC/Makefile b/Libraries/LibC/Makefile
index 391984ddca..23d9886e61 100644
--- a/Libraries/LibC/Makefile
+++ b/Libraries/LibC/Makefile
@@ -1,5 +1,3 @@
-include ../../Makefile.common
-
AK_OBJS = \
../../AK/StringImpl.o \
../../AK/String.o \
@@ -57,30 +55,37 @@ LIBC_OBJS = \
serenity.o \
syslog.o
-ASM_OBJS = setjmp.ao crti.ao crtn.ao
+OBJS = $(AK_OBJS) $(LIBC_OBJS)
-CPP_OBJS = $(AK_OBJS) $(WIDGETS_OBJS) $(LIBC_OBJS)
-
-LIBRARY = libc.a
-DEFINES += -DUSERLAND -DSERENITY_LIBC_BUILD
+EXTRA_OBJS = setjmp.ao crti.ao crtn.ao
-all: $(LIBRARY) startfiles
+.PHONY: startfiles
+startfiles: $(EXTRA_OBJS)
+ $(QUIET) cp crti.ao crti.o
+ $(QUIET) cp crtn.ao crtn.o
-startfiles: $(ASM_OBJS)
- @echo "CXX crt0.o"; $(CXX) $(CXXFLAGS) -o crt0.o -c crt0.cpp
- cp crti.ao crti.o
- cp crtn.ao crtn.o
+EXTRA_CLEAN = crt0.d
-$(LIBRARY): $(CPP_OBJS) $(ASM_OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(CPP_OBJS) $(ASM_OBJS)
+DEFINES = -DSERENITY_LIBC_BUILD
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
+LIBRARY = libc.a
-%.ao: %.S
- @echo "AS $@"; $(AS) -o $@ $<
+all: $(LIBRARY) startfiles
--include $(OBJS:%.o=%.d)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/sys/
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/bits/
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/netinet/
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/arpa/
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/lib/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/
+ cp sys/*.h $(SERENITY_BASE_DIR)/Root/usr/include/sys/
+ cp bits/*.h $(SERENITY_BASE_DIR)/Root/usr/include/bits/
+ cp arpa/*.h $(SERENITY_BASE_DIR)/Root/usr/include/arpa/
+ cp netinet/*.h $(SERENITY_BASE_DIR)/Root/usr/include/netinet/
+ cp libc.a $(SERENITY_BASE_DIR)/Root/usr/lib/
+ cp crt0.o $(SERENITY_BASE_DIR)/Root/usr/lib/
+ cp crti.ao $(SERENITY_BASE_DIR)/Root/usr/lib/crti.o
+ cp crtn.ao $(SERENITY_BASE_DIR)/Root/usr/lib/crtn.o
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(CPP_OBJS) $(ASM_OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibC/install.sh b/Libraries/LibC/install.sh
deleted file mode 100755
index cd28e10854..0000000000
--- a/Libraries/LibC/install.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/sys/
-mkdir -p $SERENITY_ROOT/Root/usr/include/bits/
-mkdir -p $SERENITY_ROOT/Root/usr/include/netinet/
-mkdir -p $SERENITY_ROOT/Root/usr/include/arpa/
-mkdir -p $SERENITY_ROOT/Root/usr/lib/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/
-cp sys/*.h $SERENITY_ROOT/Root/usr/include/sys/
-cp bits/*.h $SERENITY_ROOT/Root/usr/include/bits/
-cp arpa/*.h $SERENITY_ROOT/Root/usr/include/arpa/
-cp netinet/*.h $SERENITY_ROOT/Root/usr/include/netinet/
-cp libc.a $SERENITY_ROOT/Root/usr/lib/
-cp crt0.o $SERENITY_ROOT/Root/usr/lib/
-cp crti.ao $SERENITY_ROOT/Root/usr/lib/crti.o
-cp crtn.ao $SERENITY_ROOT/Root/usr/lib/crtn.o
diff --git a/Libraries/LibCore/Makefile b/Libraries/LibCore/Makefile
index c9f25fadef..b052d19a08 100644
--- a/Libraries/LibCore/Makefile
+++ b/Libraries/LibCore/Makefile
@@ -1,5 +1,3 @@
-include ../../Makefile.common
-
OBJS = \
CArgsParser.o \
CIODevice.o \
@@ -27,17 +25,10 @@ OBJS = \
CGzip.o
LIBRARY = libcore.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibCore/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibCore/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibCore/install.sh b/Libraries/LibCore/install.sh
deleted file mode 100755
index f9097615cb..0000000000
--- a/Libraries/LibCore/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibCore/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibCore/
-cp libcore.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibDraw/Makefile b/Libraries/LibDraw/Makefile
index dc2952ba92..8923d22f9c 100644
--- a/Libraries/LibDraw/Makefile
+++ b/Libraries/LibDraw/Makefile
@@ -1,5 +1,3 @@
-include ../../Makefile.common
-
OBJS = \
CharacterBitmap.o \
Color.o \
@@ -15,17 +13,10 @@ OBJS = \
Emoji.o
LIBRARY = libdraw.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibDraw/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibDraw/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibDraw/install.sh b/Libraries/LibDraw/install.sh
deleted file mode 100755
index 76354671fe..0000000000
--- a/Libraries/LibDraw/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibDraw/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibDraw/
-cp libdraw.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibELF/Makefile b/Libraries/LibELF/Makefile
new file mode 100644
index 0000000000..720752f1eb
--- /dev/null
+++ b/Libraries/LibELF/Makefile
@@ -0,0 +1 @@
+include ../../Makefile.common
diff --git a/Libraries/LibGUI/Makefile b/Libraries/LibGUI/Makefile
index 5c72b0c005..cc54c54b11 100644
--- a/Libraries/LibGUI/Makefile
+++ b/Libraries/LibGUI/Makefile
@@ -1,5 +1,3 @@
-include ../../Makefile.common
-
OBJS = \
GPainter.o \
GButton.o \
@@ -64,17 +62,10 @@ OBJS = \
GWindow.o
LIBRARY = libgui.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/
+ cp ./*.h $(SERENITY_BASE_DIR)/Root/usr/include/LibGUI/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibGUI/install.sh b/Libraries/LibGUI/install.sh
deleted file mode 100755
index d55a120bf9..0000000000
--- a/Libraries/LibGUI/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibGUI/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibGUI/
-cp libgui.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_cpp/Makefile b/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_cpp/Makefile
index 7e4bc8d3d3..2fbac0c056 100644
--- a/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_cpp/Makefile
+++ b/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_cpp/Makefile
@@ -1,33 +1,24 @@
+HOST_CXX = 1
+
PROGRAM = Generate_CSS_PropertyID_cpp
OBJS = \
Generate_CSS_PropertyID_cpp.o \
- $(SERENITY_ROOT)/AK/String.o \
- $(SERENITY_ROOT)/AK/StringImpl.o \
- $(SERENITY_ROOT)/AK/StringBuilder.o \
- $(SERENITY_ROOT)/AK/StringView.o \
- $(SERENITY_ROOT)/AK/JsonValue.o \
- $(SERENITY_ROOT)/AK/JsonParser.o \
- $(SERENITY_ROOT)/AK/LogStream.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CIODevice.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CFile.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CObject.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CEvent.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CSocket.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CLocalSocket.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CNotifier.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CLocalServer.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CEventLoop.o
-
-all: $(PROGRAM)
-
-CXXFLAGS = -std=c++17 -Wall -Wextra
-
-%.o: %.cpp
- $(PRE_CXX) $(CXX) $(CXXFLAGS) -I../ -I$(SERENITY_ROOT)/ -I$(SERENITY_ROOT)/Libraries/ -o $@ -c $<
-
-$(PROGRAM): $(OBJS)
- $(CXX) $(LDFLAGS) -I../ -I$(SERENITY_ROOT)/ -I$(SERENITY_ROOT)/Libraries/ -o $(PROGRAM) $(OBJS)
+ ../../../../AK/String.o \
+ ../../../../AK/StringImpl.o \
+ ../../../../AK/StringBuilder.o \
+ ../../../../AK/StringView.o \
+ ../../../../AK/JsonValue.o \
+ ../../../../AK/JsonParser.o \
+ ../../../../AK/LogStream.o \
+ ../../../../Libraries/LibCore/CIODevice.o \
+ ../../../../Libraries/LibCore/CFile.o \
+ ../../../../Libraries/LibCore/CObject.o \
+ ../../../../Libraries/LibCore/CEvent.o \
+ ../../../../Libraries/LibCore/CSocket.o \
+ ../../../../Libraries/LibCore/CLocalSocket.o \
+ ../../../../Libraries/LibCore/CNotifier.o \
+ ../../../../Libraries/LibCore/CLocalServer.o \
+ ../../../../Libraries/LibCore/CEventLoop.o
-clean:
- rm -f $(PROGRAM) $(OBJS)
+include ../../../../Makefile.common
diff --git a/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_h/Makefile b/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_h/Makefile
index 783256d9e9..aff0892a8d 100644
--- a/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_h/Makefile
+++ b/Libraries/LibHTML/CodeGenerators/Generate_CSS_PropertyID_h/Makefile
@@ -1,33 +1,24 @@
+HOST_CXX = 1
+
PROGRAM = Generate_CSS_PropertyID_h
OBJS = \
Generate_CSS_PropertyID_h.o \
- $(SERENITY_ROOT)/AK/String.o \
- $(SERENITY_ROOT)/AK/StringImpl.o \
- $(SERENITY_ROOT)/AK/StringBuilder.o \
- $(SERENITY_ROOT)/AK/StringView.o \
- $(SERENITY_ROOT)/AK/JsonValue.o \
- $(SERENITY_ROOT)/AK/JsonParser.o \
- $(SERENITY_ROOT)/AK/LogStream.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CIODevice.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CFile.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CObject.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CEvent.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CSocket.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CLocalSocket.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CNotifier.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CLocalServer.o \
- $(SERENITY_ROOT)/Libraries/LibCore/CEventLoop.o
-
-all: $(PROGRAM)
-
-CXXFLAGS = -std=c++17 -Wall -Wextra
-
-%.o: %.cpp
- $(PRE_CXX) $(CXX) $(CXXFLAGS) -I../ -I$(SERENITY_ROOT)/ -I$(SERENITY_ROOT)/Libraries/ -o $@ -c $<
-
-$(PROGRAM): $(OBJS)
- $(CXX) $(LDFLAGS) -I../ -I$(SERENITY_ROOT)/ -I$(SERENITY_ROOT)/Libraries/ -o $(PROGRAM) $(OBJS)
+ ../../../../AK/String.o \
+ ../../../../AK/StringImpl.o \
+ ../../../../AK/StringBuilder.o \
+ ../../../../AK/StringView.o \
+ ../../../../AK/JsonValue.o \
+ ../../../../AK/JsonParser.o \
+ ../../../../AK/LogStream.o \
+ ../../../../Libraries/LibCore/CIODevice.o \
+ ../../../../Libraries/LibCore/CFile.o \
+ ../../../../Libraries/LibCore/CObject.o \
+ ../../../../Libraries/LibCore/CEvent.o \
+ ../../../../Libraries/LibCore/CSocket.o \
+ ../../../../Libraries/LibCore/CLocalSocket.o \
+ ../../../../Libraries/LibCore/CNotifier.o \
+ ../../../../Libraries/LibCore/CLocalServer.o \
+ ../../../../Libraries/LibCore/CEventLoop.o
-clean:
- rm -f $(PROGRAM) $(OBJS)
+include ../../../../Makefile.common
diff --git a/Libraries/LibHTML/Makefile b/Libraries/LibHTML/Makefile
index 4090c7f9ac..c0a1672c0c 100644
--- a/Libraries/LibHTML/Makefile
+++ b/Libraries/LibHTML/Makefile
@@ -1,9 +1,3 @@
-include ../../Makefile.common
-
-LIBRARY = libhtml.a
-
-all: $(LIBRARY)
-
LIBHTML_OBJS = \
CSS/DefaultStyleSheetSource.o \
CSS/PropertyID.o \
@@ -68,33 +62,32 @@ LIBHTML_OBJS = \
Parser/HTMLParser.o \
ResourceLoader.o
-GENERATED_SOURCES = \
+EXTRA_SOURCES = \
CSS/DefaultStyleSheetSource.cpp \
CSS/PropertyID.h \
CSS/PropertyID.cpp
-OBJS = $(EXTRA_OBJS) $(LIBHTML_OBJS)
-
-LIBRARY = libhtml.a
-DEFINES += -DUSERLAND
-
CSS/DefaultStyleSheetSource.cpp: CSS/Default.css Scripts/GenerateStyleSheetSource.sh
- @echo "GENERATE $@"; Scripts/GenerateStyleSheetSource.sh default_stylesheet_source $< > $@
+ @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
- @echo "GENERATE $@"; CodeGenerators/Generate_CSS_PropertyID_h/Generate_CSS_PropertyID_h $< > $@
+ @echo "GENERATE $@"
+ $(QUIET) CodeGenerators/Generate_CSS_PropertyID_h/Generate_CSS_PropertyID_h $< > $@
CSS/PropertyID.cpp: CSS/Properties.json CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp.cpp
- @echo "GENERATE $@"; CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp $< > $@
-
-%.o: %.cpp $(GENERATED_SOURCES)
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
+ @echo "GENERATE $@"
+ $(QUIET) CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_CSS_PropertyID_cpp $< > $@
--include $(OBJS:%.o=%.d)
+OBJS = $(EXTRA_OBJS) $(LIBHTML_OBJS)
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d $(GENERATED_SOURCES)
+LIBRARY = libhtml.a
-$(LIBRARY): $(GENERATED_SOURCES) $(LIBHTML_OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(LIBHTML_OBJS)
+install:
+ for dir in . Parser DOM CSS Layout; do \
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibHTML/$$dir; \
+ cp $$dir/*.h $(SERENITY_BASE_DIR)/Root/usr/include/LibHTML/$$dir/; \
+ done
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
+include ../../Makefile.common
diff --git a/Libraries/LibHTML/install.sh b/Libraries/LibHTML/install.sh
deleted file mode 100755
index 11a80fcdde..0000000000
--- a/Libraries/LibHTML/install.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-for dir in . Parser DOM CSS Layout; do
- mkdir -p $SERENITY_ROOT/Root/usr/include/LibHTML/$dir
- cp $dir/*.h $SERENITY_ROOT/Root/usr/include/LibHTML/$dir/
-done
-
-cp libhtml.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibIPC/Makefile b/Libraries/LibIPC/Makefile
index c7bc2904dc..2f1de2f795 100644
--- a/Libraries/LibIPC/Makefile
+++ b/Libraries/LibIPC/Makefile
@@ -1,21 +1,12 @@
-include ../../Makefile.common
-
OBJS = \
IEndpoint.o \
IMessage.o
LIBRARY = libipc.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibIPC/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibIPC/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibIPC/install.sh b/Libraries/LibIPC/install.sh
deleted file mode 100755
index ffbb34199c..0000000000
--- a/Libraries/LibIPC/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibIPC/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibIPC/
-cp libipc.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibM/Makefile b/Libraries/LibM/Makefile
index 983f8d1a69..b6c619b47d 100644
--- a/Libraries/LibM/Makefile
+++ b/Libraries/LibM/Makefile
@@ -1,19 +1,11 @@
-include ../../Makefile.common
-
OBJS = math.o
LIBRARY = libm.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/sys/
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/lib/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibM/install.sh b/Libraries/LibM/install.sh
deleted file mode 100755
index 827d31e385..0000000000
--- a/Libraries/LibM/install.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/sys/
-mkdir -p $SERENITY_ROOT/Root/usr/lib/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/
-cp libm.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibMarkdown/Makefile b/Libraries/LibMarkdown/Makefile
index 295fc19cdb..7828776bd4 100644
--- a/Libraries/LibMarkdown/Makefile
+++ b/Libraries/LibMarkdown/Makefile
@@ -1,25 +1,16 @@
-include ../../Makefile.common
-
OBJS = \
MDDocument.o \
- MDParagraph.o \
- MDHeading.o \
- MDCodeBlock.o \
- MDList.o \
- MDText.o
+ MDParagraph.o \
+ MDHeading.o \
+ MDCodeBlock.o \
+ MDList.o \
+ MDText.o
LIBRARY = libmarkdown.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibMarkdown/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibMarkdown/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibMarkdown/install.sh b/Libraries/LibMarkdown/install.sh
deleted file mode 100755
index 0f40a59675..0000000000
--- a/Libraries/LibMarkdown/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibMarkdown/
-cp *.h $SERENITY_ROOT/Root/usr/include/LibMarkdown/
-cp libmarkdown.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibPCIDB/Makefile b/Libraries/LibPCIDB/Makefile
index 990099fa01..9f8c27f86b 100644
--- a/Libraries/LibPCIDB/Makefile
+++ b/Libraries/LibPCIDB/Makefile
@@ -1,20 +1,11 @@
-include ../../Makefile.common
-
OBJS = \
Database.o
LIBRARY = libpcidb.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibPCIDB/
+ cp ./*.h $(SERENITY_BASE_DIR)/Root/usr/include/LibPCIDB/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibPCIDB/install.sh b/Libraries/LibPCIDB/install.sh
deleted file mode 100755
index da4f78a4aa..0000000000
--- a/Libraries/LibPCIDB/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibPCIDB/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibPCIDB/
-cp libpcidb.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibProtocol/Makefile b/Libraries/LibProtocol/Makefile
index 0f34357db9..b734a6e440 100644
--- a/Libraries/LibProtocol/Makefile
+++ b/Libraries/LibProtocol/Makefile
@@ -1,21 +1,7 @@
-include ../../Makefile.common
-
OBJS = \
Download.o \
Client.o
LIBRARY = libprotocol.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibPthread/Makefile b/Libraries/LibPthread/Makefile
index 993ee2cdb9..e004c95272 100644
--- a/Libraries/LibPthread/Makefile
+++ b/Libraries/LibPthread/Makefile
@@ -1,19 +1,10 @@
-include ../../Makefile.common
-
OBJS = pthread.o
LIBRARY = libpthread.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/lib/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibPthread/install.sh b/Libraries/LibPthread/install.sh
deleted file mode 100755
index 4a7d00c6d1..0000000000
--- a/Libraries/LibPthread/install.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/sys/
-mkdir -p $SERENITY_ROOT/Root/usr/lib/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/
-cp libpthread.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibThread/Makefile b/Libraries/LibThread/Makefile
index bc548c208a..57c2ae93b5 100644
--- a/Libraries/LibThread/Makefile
+++ b/Libraries/LibThread/Makefile
@@ -1,21 +1,12 @@
-include ../../Makefile.common
-
OBJS = \
Thread.o \
BackgroundAction.o
LIBRARY = libthread.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
+install:
+ mkdir -p $(SERENITY_BASE_DIR)/Root/usr/include/LibThread/
+ cp *.h $(SERENITY_BASE_DIR)/Root/usr/include/LibThread/
+ cp $(LIBRARY) $(SERENITY_BASE_DIR)/Root/usr/lib/
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/LibThread/install.sh b/Libraries/LibThread/install.sh
deleted file mode 100755
index 3044ca1b63..0000000000
--- a/Libraries/LibThread/install.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-
-set -e
-SERENITY_ROOT=../../
-
-mkdir -p $SERENITY_ROOT/Root/usr/include/LibThread/
-cp ./*.h $SERENITY_ROOT/Root/usr/include/LibThread/
-cp libthread.a $SERENITY_ROOT/Root/usr/lib/
diff --git a/Libraries/LibVT/Makefile b/Libraries/LibVT/Makefile
index ba58d2af19..7aefbbb078 100644
--- a/Libraries/LibVT/Makefile
+++ b/Libraries/LibVT/Makefile
@@ -1,21 +1,7 @@
-include ../../Makefile.common
-
OBJS = \
Terminal.o \
TerminalWidget.o
LIBRARY = libvt.a
-DEFINES += -DUSERLAND
-
-all: $(LIBRARY)
-
-$(LIBRARY): $(OBJS)
- @echo "LIB $@"; $(AR) rcs $@ $(OBJS) $(LIBS)
-.cpp.o:
- @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $<
-
--include $(OBJS:%.o=%.d)
-
-clean:
- @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d
+include ../../Makefile.common
diff --git a/Libraries/Makefile b/Libraries/Makefile
new file mode 100644
index 0000000000..6a7b80e895
--- /dev/null
+++ b/Libraries/Makefile
@@ -0,0 +1,3 @@
+SUBDIRS := $(wildcard */.)
+
+include ../Makefile.subdir