Skip to content

Commit

Permalink
tests: build test multiboot kernel
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianfreyer committed Feb 18, 2018
1 parent 7578f81 commit 10a9737
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 22 additions & 10 deletions tests/data/multiboot/Makefile
Original file line number Diff line number Diff line change
@@ -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 $@ $<

0 comments on commit 10a9737

Please sign in to comment.