From 2e96fc06f325110af8c7177c0c60694eed5fd245 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 2 Jan 2024 17:28:59 -0300 Subject: Fix the build system. The improvements are: - use most of the default "Makefile" for standard packaging; - also use the default ".gitignore" with for the derived assets; - don't impose so many $CFLAGS on the user. GCC still needs to be given the `-ffreestanding` flag explicitly for us to get a good binary; - stop using ad-hoc tools/* scripts, and avoid the code-generation anti-pattern overall on the build. Some of the generated files were checked-in, and some were removed; - remove empty files; - use POSIX make(1) over gmake; - add fuzz targets; - partial "install" and "uninstall" targets; - complete "clean" target. The shortcomings are: - only working on x86_64. More platforms coming soon; - code is still messy: way too many warnings, GNU/BSD specific extensions, inline assembly, and all kinds of unportable code; - still only works with GCC and GCC-like compilers, and completly fails with tcc(1) and cproc(1); - the `deps.mk` file is being maintained manually. As I work on the source files I'll finish automating its generation with `mkdeps.sh`; - still seems to be coupled with Linux; - still is missing tests setup; - still uses `#include <$NAME.h>` instead of the correct `#include "$NAME.h"` form. The generated libgrovel.a did match the previous lib/libc.a 100%. --- src/config.h.in | 0 src/grovel.h | 0 src/main.c | 4 ++++ src/setjmp/longjmp.c | 0 src/setjmp/setjmp.c | 0 src/signal/sigsetjmp.c | 0 src/thread/syscall_cp.c | 0 7 files changed, 4 insertions(+) create mode 100644 src/config.h.in create mode 100644 src/grovel.h create mode 100644 src/main.c delete mode 100644 src/setjmp/longjmp.c delete mode 100644 src/setjmp/setjmp.c delete mode 100644 src/signal/sigsetjmp.c delete mode 100644 src/thread/syscall_cp.c (limited to 'src') diff --git a/src/config.h.in b/src/config.h.in new file mode 100644 index 00000000..e69de29b diff --git a/src/grovel.h b/src/grovel.h new file mode 100644 index 00000000..e69de29b diff --git a/src/main.c b/src/main.c new file mode 100644 index 00000000..1d658dd1 --- /dev/null +++ b/src/main.c @@ -0,0 +1,4 @@ +int +main(void) { + return 0; +} diff --git a/src/setjmp/longjmp.c b/src/setjmp/longjmp.c deleted file mode 100644 index e69de29b..00000000 diff --git a/src/setjmp/setjmp.c b/src/setjmp/setjmp.c deleted file mode 100644 index e69de29b..00000000 diff --git a/src/signal/sigsetjmp.c b/src/signal/sigsetjmp.c deleted file mode 100644 index e69de29b..00000000 diff --git a/src/thread/syscall_cp.c b/src/thread/syscall_cp.c deleted file mode 100644 index e69de29b..00000000 -- cgit v1.2.3