From 10a9737e635a0f23e063137f3f7e841e1c9841e4 Mon Sep 17 00:00:00 2001 From: Fabian Freyer Date: Sun, 18 Feb 2018 14:05:28 +0000 Subject: [PATCH] tests: build test multiboot kernel --- ci/Dockerfile | 2 +- tests/data/multiboot/Makefile | 32 ++++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index 6aae42c..93668d8 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -17,7 +17,7 @@ ADD ./ci/install_kyua.sh /ci/install_kyua.sh RUN sh /ci/install_kyua.sh RUN apt-get install -qq freebsd-buildutils bmake libelf-freebsd-dev -RUN apt-get install -qq gcc-7 clang-5.0 +RUN apt-get install -qq gcc-7 clang-5.0 lib32gcc-7-dev RUN apt-get install -qq curl ADD . /build diff --git a/tests/data/multiboot/Makefile b/tests/data/multiboot/Makefile index 36f01dc..2e89b56 100644 --- a/tests/data/multiboot/Makefile +++ b/tests/data/multiboot/Makefile @@ -1,21 +1,33 @@ -CC=gcc CCFLAGS=-m32 -Wall -Wextra -Werror -fno-stack-protector -nostdinc -fno-builtin ASFLAGS=-m32 -LD=ld -LDFLAGS=-melf_i386 -T link.ld -LIBS=$(shell $(CC) $(CCFLAGS) -print-libgcc-file-name) +UNAME_S!=uname -s +LIBGCC!=$(CC) ${CCFLAGS} -print-libgcc-file-name +LDEMULATION=elf_i386 +.if ${UNAME_S:MFreeBSD} +LDEMULATION=elf_i386_fbsd +.endif + +LDFLAGS=-m${LDEMULATION} -T link.ld + +.PHONY: all all: mmap.elf modules.elf +.PHONY: clean +clean: + rm -f start.o mmap.o libc.o test-multiboot.o + rm -f mmap.elf + rm -f modules.elf + mmap.elf: start.o mmap.o libc.o - $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) + $(LD) $(LDFLAGS) -o $@ $> $(LIBGCC) modules.elf: start.o modules.o libc.o - $(LD) $(LDFLAGS) -o $@ $^ $(LIBS) + $(LD) $(LDFLAGS) -o $@ $> $(LIBGCC) -%.o: %.c - $(CC) $(CCFLAGS) -c -o $@ $^ +.c.o: + $(CC) $(CCFLAGS) -c -o $@ $< -%.o: %.S - $(CC) $(ASFLAGS) -c -o $@ $^ +.S.o: + $(CC) $(ASFLAGS) -c -o $@ $<