57 lines
1006 B
Makefile
57 lines
1006 B
Makefile
.POSIX:
|
|
|
|
CC = clang
|
|
AS = clang
|
|
LD = ld.lld
|
|
|
|
CFLAGS = -c -nostdlib -ffreestanding -fno-builtin -target i386-elf -m32
|
|
CFLAGS += -I.
|
|
CFLAGS += -I../../arch/i386/include
|
|
CFLAGS += -I../../kernel
|
|
|
|
DEPENDFLAGS = -E -MM
|
|
DEPENDFLAGS += -I.
|
|
DEPENDFLAGS += -I../../arch/i386/include
|
|
DEPENDFLAGS += -I../../kernel
|
|
|
|
LDFLAGS = -nostdlib -T ../../kernel/i386/conf/kernel.ld
|
|
|
|
ROOT=../..
|
|
|
|
#### MAKEOPTIONS start here
|
|
%%MAKEOPTIONS
|
|
#### MAKEOPTIONS end here
|
|
|
|
.PHONY: clean
|
|
|
|
#### OBJS start here
|
|
%%OBJS
|
|
#### OBJS end here
|
|
|
|
#### SRCS start here
|
|
%%SRCS
|
|
#### SRCS end here
|
|
|
|
kernel: ${OBJS}
|
|
${LD} ${LDFLAGS} -o kernel ${OBJS}
|
|
|
|
# If the .depend file is available, rules will be imported.
|
|
-include .depend
|
|
|
|
# Rebuild the .depend file using the rules database
|
|
.depend: ${SRCS}
|
|
${CC} ${DEPENDFLAGS} ${SRCS} > .depend
|
|
|
|
#### RULES start here
|
|
%%RULES
|
|
#### RULES end here
|
|
|
|
qemu: kernel
|
|
qemu-system-i386 -kernel kernel -serial stdio
|
|
|
|
qemu-gdb: kernel
|
|
qemu-system-i386 -kernel kernel -serial stdio -s -S
|
|
|
|
clean:
|
|
rm -f kernel ${OBJS}
|