Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (25 sloc) 706 Bytes
CC:=clang
LD:=ld
AS:=nasm
NAME= piccolo
QEMU:= qemu-system-i386
SOURCE_SUFFIXES := '(' -name '*.c' -o -name '*.s' ')'
SRCFILES := $(shell find 'src' ${SOURCE_SUFFIXES})
OBJFILES := $(patsubst %.s,%.s.o,$(patsubst %.c,%.c.o,$(SRCFILES)))
CFLAGS=-std=c99 -Wall -Wextra -nostdlib -nostartfiles -nodefaultlibs -fno-builtin -Iinclude
ASFLAGS=
all: $(NAME).iso
$(NAME).iso: $(NAME)
@./makeiso.sh
$(NAME): $(OBJFILES)
$(LD) -melf_i386 -nostdlib -T src/link.ld -o piccolo $(OBJFILES)
%.s.o: %.s
$(AS) -felf32 -o $@ $<
%.c.o: %.c
$(CC) $(CFLAGS) -m32 -o $@ -c $<
test: $(NAME).iso
@./test.sh "$(QEMU)"
qemu: test
clean:
-rm -f src/*.o isofs/System/* iso/$(NAME).iso
.PHONY: all test qemu clean