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 65b5fb4 commit 53e3518
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ matrix:

before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq freebsd-buildutils bmake libelf-freebsd-dev liblua5.2-dev libsqlite3-dev
- sudo apt-get install -qq freebsd-buildutils bmake libelf-freebsd-dev liblua5.2-dev libsqlite3-dev build-essential
- ci/install_atf.sh
- ci/install_lutok.sh
- ci/install_kyua.sh
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 53e3518

Please sign in to comment.