Commit graph

45 commits

Author SHA1 Message Date
Andreas Kling
603bf6fb4a Build: Remove -fno-sized-deallocation -Wno-sized-deallocation
Add sized variants of the global operator delete functions so we don't
have to use these GCC options anymore.
2020-01-25 16:59:21 +01:00
joshua stein
5e430e4eb4 Build: add support for building on OpenBSD
This requires gcc8 from ports to build the Toolchain.
2020-01-02 21:03:53 +01:00
joshua stein
d61131945d Build: HOST_CXX -> USE_HOST_CXX
Allow HOST_CXX to be passed to make which will be the actual host
C++ compiler used, such as 'make HOST_CXX=clang++'.
2020-01-02 21:03:53 +01:00
joshua stein
99e06c53e5 Build: show directory during compilation, remove default rules
When using -j, it can be confusing to see files being compiled out
of order, so prefix compilation with the directory it's building
for.
2020-01-01 22:21:50 +01:00
joshua stein
0b501335f5 Build: wrap make invocations with flock(1)
Lock each directory before entering it so when using -j, the same
dependency isn't built more than once at a time.

This doesn't get full -j parallelism though, since one make child
will be sitting idle waiting for flock to receive its lock and
continue making (which should then do nothing since it will have
been built already).  Unfortunately there's not much that can be
done to fix that since it can't proceed until its dependency is
built by another make process.
2019-12-28 21:09:33 +01:00
joshua stein
2d7259e0a0 Build: Put C and M at the front of $LIB_DEPS to build first 2019-12-28 21:09:33 +01:00
Stefano Cristiano
250f6b9a1e Build: Disable unknown GCC specific warnings when compiling host tools using clang 2019-12-27 02:19:55 +01:00
Stefano Cristiano
18e3e4f236 Build: Make sure that RANLIB and AR use cross-compiler provided executables
This is very much needed when compiling host tools on macOS for example
2019-12-27 02:19:55 +01:00
Andreas Kling
4883176fd8 Build: Make sure we build everyone's STATIC_LIB_DEPS first
If a program's compilation depends on something generated by a library,
we need to make sure that library is built before any of the program's
own compilation units.
2019-12-25 13:35:57 +01:00
joshua stein
c127d16326 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.
2019-12-25 10:11:09 +01:00
joshua stein
0343be3837 Build: support compilation of .c files 2019-12-25 10:11:09 +01:00
Sergey Bugaev
1025fb53ee Build: Ensure "install" is a phony target
See https://github.com/SerenityOS/serenity/issues/897
2019-12-23 14:55:17 +01:00
Andreas Kling
2e280417e2 Build: Let's say "C++" while building .cpp files 2019-12-22 19:52:24 +01:00
joshua stein
23158aef2e Build: only setup git defines for About application 2019-12-20 23:55:08 +01:00
Andreas Kling
44bc4008b7 Build: Get rid of the USERLAND define
Let's simplify things. There is now only KERNEL.
To see if you're on Serenity, check if __serenity__ is defined.
2019-12-20 22:59:11 +01:00
Andreas Kling
4d1ce18477 Build: Add Libraries/LibPCIDB to library search path 2019-12-20 21:10:08 +01:00
Andreas Kling
a8d69f4b76 Build: Add Libraries/LibPthread to the default includes 2019-12-20 21:06:26 +01:00
Andreas Kling
842716a0b5 Kernel+LibC: Build with basic -fstack-protector support
Use simple stack cookies to try to provoke an assertion failure on
stack overflow.

This is far from perfect, since we use a constant cookie instead of
generating a random one on startup, but it can still help us catch
bugs, which is the primary concern right now. :^)
2019-12-20 21:03:32 +01:00
Andreas Kling
f006e66a25 Kernel: Make sure we build with -mno-387, -mno-sse, etc. 2019-12-20 21:01:30 +01:00
Andreas Kling
69c24b1ddb Build: Add PRE_CXX before the host CXX as well
This allows the use of ccache for building the host-side tools.
2019-12-20 20:22:08 +01:00
joshua stein
ac25438d54 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.
2019-12-20 20:20:54 +01:00
Philip Herron
c73aa662bb Update toolchain to binutils-2.33.1 gcc-9.2.0
Toolchain build makes git repo out of toolchain to allow patching
Fix Makefiles to use new libstdc++
Parameterize BuildIt with default TARGET of i686 but arm is experimental
2019-12-19 18:35:03 +01:00
Jonathan Archer
3f45ccffa6 Build System: Add common definitions for git info
Defs for commit, branch, and changes (status)
2019-12-02 09:21:47 +01:00
Andreas Kling
fd4349a9f2 ProtocolServer+LibProtocol: Introduce a server for handling downloads
This patch adds ProtocolServer, a server that handles network requests
on behalf of its clients. The first protocol implemented is HTTP.

The idea here is to use a plug-in architecture where any number of
protocols can be added and implemented without having to mess around
with each client program that wants to use the protocol.

A simple client API is provided through LibProtocol::Client. :^)
2019-11-23 21:50:32 +01:00
Andreas Kling
d1c984da82 Build: Make sure we look in Libraries/LibPthread for libraries :^) 2019-11-16 12:23:40 +01:00
Andreas Kling
69ca9cfd78 LibPthread: Start working on a POSIX threading library
This patch adds pthread_create() and pthread_exit(), which currently
simply wrap our existing create_thread() and exit_thread() syscalls.

LibThread is also ported to using LibPthread.
2019-11-13 21:49:24 +01:00
Sergey Bugaev
3c90aab7dd Build: Add LibMarkdown to the library search path 2019-10-03 08:23:54 +02:00
Andreas Kling
93230386f7 Build: Add Libraries/LibHTML/ to the library search paths
This makes my hacky incremental rebuild commands work for LibHTML.
2019-09-29 16:20:54 +02:00
Conrad Pankoff
0706bf470f Meta: Add a LINK alias to the common makefile for running ld explicitly 2019-09-16 07:49:43 +02:00
Sergey Bugaev
e1a6f8a27d LibThread: Introduce a new threading library
This library is meant to provide C++-style wrappers over lower
level APIs such as syscalls and pthread_* functions, as well as
utilities for easily running pieces of logic on different
threads.
2019-08-26 11:31:14 +02:00
Andreas Kling
b24b111298 LibVT: Factor out terminal emulation from Terminal to make it reusable
Now that we're bringing back the in-kernel virtual console, we should
move towards having a single implementation of terminal emulation.

This patch rips out the emulation code from the Terminal application
and turns it into the beginnings of LibVT.

The basic design idea is that users of VT::Terminal will implement and
provide a VT::TerminalClient subclass to handle presentation-specific
things. We'll need to iterate on this, but it's a start. :^)
2019-08-12 17:34:48 +02:00
Andreas Kling
8e684f0959 AudioServer: Port to the new generated IPC mechanism
Fork the IPC Connection classes into Server:: and Client::ConnectionNG.
The new IPC messages are serialized very snugly instead of using the
same generic data structure for all messages.

Remove ASAPI.h since we now generate all of it from AudioServer.ipc :^)
2019-08-03 19:49:19 +02:00
Andreas Kling
3c1bad99a2 AudioServer: Link against LibIPC
We're not using any of the functionality yet, but soon...
2019-08-03 17:25:54 +02:00
Andreas Kling
1c0669f010 LibDraw: Introduce (formerly known as SharedGraphics.)
Instead of LibGUI and WindowServer building their own copies of the drawing
and graphics code, let's it in a separate LibDraw library.

This avoids building the code twice, and will encourage better separation
of concerns. :^)
2019-07-18 10:18:16 +02:00
Robin Burchell
ffa8cb668f AudioServer: Assorted infrastructure work
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader)
* Add CLocalSocket, and CSocket::connect() variant for local address types.
  We make some small use of this in WindowServer (as that's where we
  modelled it from), but don't get too invasive as this PR is already
  quite large, and the WS I/O is a bit carefully done
* Add an AClientConnection which will eventually be used to talk to
  AudioServer (and make use of it in Piano, though right now it really
  doesn't do anything except connect, using our new CLocalSocket...)
2019-07-13 22:57:24 +02:00
Andreas Kling
fe69b326e9 Build: Prepend $PRE_CXX before the C++ compiler.
This allows you to set e.g PRE_CXX=ccache in your environment and enjoy
cached rebuilds. This makes "./makeall.sh" take 5 seconds instead of 50
seconds on my machine. :^)
2019-07-09 19:24:05 +02:00
Andreas Kling
c452aa891f AK: Add Platform.h with an ARCH() macro.
You can currently use this to detect the CPU architecture like so:

    #if ARCH(I386)
        ...
    #elif ARCH(X86_64)
        ...
    #else
        ...
    #endif

This will be helpful for separating out architecture-specific code blocks.
2019-07-09 15:48:04 +02:00
Andreas Kling
04b9dc2d30 Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
2019-07-04 16:16:50 +02:00
Andreas Kling
04b2082e97 Build: Enable the -Werror flag.
Okay, I've now fixed all the warnings and it was pretty lame. Let's keep the
build warning-free from now on.
2019-06-22 16:32:04 +02:00
Andreas Kling
7a2da54c07 Only the kernel needs to build with default includes disabled. 2019-05-16 13:40:43 +02:00
Andreas Kling
f3aec1a0d9 Painter: Re-enable diagonal draw_line().
This code still needs clipping, but the basic concept works. It was disabled
since before the kernel had floating point support.
2019-05-04 23:40:52 +02:00
Andreas Kling
c1b310c5bf Build: Let's skip the --gc-sections linker option for now. 2019-04-24 01:57:51 +02:00
Andreas Kling
0c898e3c2c Put assertions behind a DEBUG flag to make it easy to build without them. 2019-04-23 21:52:02 +02:00
Andreas Kling
f3754b8429 Build: Pass --gc-sections to the linker in all builds.
This removes unused sections from the output and reduces the binary size
of everything we compile.
2019-04-23 21:37:10 +02:00
Andreas Kling
74b94da6fa Add a Makefile.common with stuff shared by all Makefiles.
Compiler names, CXXFLAGS, and such. I should have done this ages ago.
2019-04-21 04:06:31 +02:00