aboutsummaryrefslogtreecommitdiff
path: root/Makefile.config
diff options
context:
space:
mode:
authoraqua <aqua@iserlohn-fortress.net>2023-02-05 10:16:20 +0200
committeraqua <aqua@iserlohn-fortress.net>2023-02-05 10:16:20 +0200
commita5de90c48a1800c865285945aadd019fa07c7ad8 (patch)
treea2e476f4950aa142019617779f8e0bce4a01305c /Makefile.config
parentblake2: use makefiles instead of meson.build (diff)
downloadkernel-a5de90c48a1800c865285945aadd019fa07c7ad8.tar.xz
Split Makefile
- Makefile: configure, doc and test targets - Makefile.all: info, build and run targets - rules.mk: add base test targets
Diffstat (limited to 'Makefile.config')
-rw-r--r--Makefile.config35
1 files changed, 27 insertions, 8 deletions
diff --git a/Makefile.config b/Makefile.config
index 42aa510..bbff402 100644
--- a/Makefile.config
+++ b/Makefile.config
@@ -1,3 +1,6 @@
+## This is a generated file, manual edits might be lost
+
+## .config
#
# Toolchain
@@ -22,24 +25,40 @@ CONFIG_VGA_TEXT_MODE=y
CONFIG_KB_PS2=y
# end of Devices
-# toolchain.mk
+## toolchain.mk
ARCH=i686
# define compiler, linker, archiver and strip and their flags
# FIXME: cpp threadsafe statics
AS := i686-elf-as
+
CC := i686-elf-gcc
-CXX := i686-elf-g++
+CCID := $(shell ${CC} --version | head -n1)
CFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -fanalyzer -ffreestanding -std=gnu11 \
- -mgeneral-regs-only
-CFLAGS += $(shell echo ${CONFIG_CFLAGS})
+ -mgeneral-regs-only \
+ $(shell echo ${CONFIG_CFLAGS})
+
+CXX := i686-elf-g++
+CXXID := $(shell ${CXX} --version | head -n1)
CXXFLAGS := -Wall -Wextra -Wpedantic -Wshadow -Wconversion -ffreestanding -std=c++17 \
- -mgeneral-regs-only -fno-use-cxa-atexit -fno-threadsafe-statics -fno-exceptions -fno-rtti
-CXXFLAGS += $(shell echo ${CONFIG_CXXFLAGS})
+ -mgeneral-regs-only -fno-use-cxa-atexit -fno-threadsafe-statics -fno-exceptions -fno-rtti \
+ $(shell echo ${CONFIG_CXXFLAGS})
+
LD := i686-elf-ld
-LDFLAGS := -static -nostdlib
-LDFLAGS += $(shell echo ${CONFIG_LDFLAGS})
+LDID := $(shell ${LD} --version | head -n1)
+LDFLAGS := -static -nostdlib \
+ $(shell echo ${CONFIG_LDFLAGS})
+
AR := i686-elf-ar
ARFLAGS := -crus
+
STRIP := i686-elf-strip
+# define compiler and flags for test targets
+TEST_CXX := g++
+TEST_CXXFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Werror=conversion -g -Og \
+ $(shell pkg-config --cflags --libs gtest gtest_main gmock)
+
+# emulator name and flags
+QEMU := qemu-system-i386 -accel kvm -machine pc
+