mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
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.
This commit is contained in:
parent
f4b2b72c8e
commit
ac25438d54
92 changed files with 527 additions and 929 deletions
|
@ -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
|
||||
../../../../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
|
||||
|
||||
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)
|
||||
|
||||
clean:
|
||||
rm -f $(PROGRAM) $(OBJS)
|
||||
include ../../../../Makefile.common
|
||||
|
|
|
@ -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
|
||||
../../../../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
|
||||
|
||||
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)
|
||||
|
||||
clean:
|
||||
rm -f $(PROGRAM) $(OBJS)
|
||||
include ../../../../Makefile.common
|
||||
|
|
|
@ -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
|
||||
|
||||
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
|
||||
@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 $@"
|
||||
$(QUIET) CodeGenerators/Generate_CSS_PropertyID_cpp/Generate_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 $< > $@
|
||||
|
||||
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 $< > $@
|
||||
|
||||
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 $<
|
||||
|
||||
-include $(OBJS:%.o=%.d)
|
||||
|
||||
clean:
|
||||
@echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d $(GENERATED_SOURCES)
|
||||
|
||||
$(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
|
||||
|
|
|
@ -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/
|
Loading…
Add table
Add a link
Reference in a new issue