include $(ROOT)/usr/include/make/SCdefs

TARGETS = \
    rom.bin \
    flipper.bin

CFILES = \
    bootc.c \
    memory.c

LIB_OBJS = \
    boots.o \
    bootc.o

DVLIBS = libromboot.a

ROM_OBJS = \
    $(DVLIBS) \
    memory.o

FLIPPER_OBJS = \
    flips.o \
    flipc.o \
    memory.o

default: exports $(TARGETS)

install: default
	$(INSTALL) $(TARGETS) $(ROOT)/usr/bin/sc

include $(COMMONRULES)

LDIRT += $(DVLIBS) rom.elf flipper.elf

libromboot.a:	$(LIB_OBJS)
	ar rc $@ $^

rom.elf: $(ROM_OBJS)
	$(LD) -T linker.dat -u _start -o $@ $(ROM_OBJS)

flipper.elf: $(FLIPPER_OBJS)
	$(LD) -T linker.dat -o $@ $(FLIPPER_OBJS)
