blob: f3f4732b4c97312921f5268529d012505b70f272 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
ARCH=i686
# define compiler, linker, archiver and strip and their flags
${ARCH}_AS := i686-elf-as
${ARCH}_CC := i686-elf-gcc
${ARCH}_CCID := $(shell ${${ARCH}_CC} --version | head -n1)
${ARCH}_CFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion -fanalyzer \
-D__ARCH__="${ARCH}" -ffreestanding -std=gnu11 -mgeneral-regs-only \
$(shell echo ${CONFIG_CFLAGS})
${ARCH}_LD := i686-elf-ld
${ARCH}_LDID := $(shell ${${ARCH}_LD} --version | head -n1)
${ARCH}_LDFLAGS := -static -nostdlib \
$(shell echo ${CONFIG_LDFLAGS})
${ARCH}_AR := i686-elf-ar
${ARCH}_ARFLAGS := -crus
${ARCH}_STRIP := i686-elf-strip
# define compiler and flags for test targets
HOST_CC := gcc
HOST_CFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion \
${CFLAGS}
HOST_CXX := g++
HOST_CXXFLAGS := -Wall -Wextra -Wpedantic -Werror=shadow -Wconversion -g -Og \
$(shell pkg-config --cflags gtest gtest_main gmock) \
${CXXFLAGS}
HOST_LDFLAGS := $(shell pkg-config --libs gtest gtest_main gmock)
# emulator name and flags
QEMU := qemu-system-i386 -accel kvm -machine pc
|