# Rules for making cyborn stuff
# For my system, V is mapped to where cyborn is, so:
# Do this in the environment: export CYBORNPATH=cygdrive/v/projects/cyborn
#

include $(CYBORNPATH)/build/cyborn.mk


########################### change the PROGNAME to the name of the working.c
############################ the file with 'main' in it
PROGNAME = flashloader


#when making a .boot, always put $(BOOTPROGRAM) first! see cyborn.mk
OBJFILES = $(BOOTPROGRAM) $(PROGNAME).o cyConsole.o

# Note that the layout for the OS should be in flash at 0x100000

#default target - the one that will be uploaded to the cybiko
#First make the object files (implicit rules), link and convert
$(PROGNAME).boot: $(OBJFILES) $(LIBPATH)/libload.a Makefile
	$(TOOLPATH)ld.exe -T $(BOOTLAYOUT) $(OBJFILES) $(LIBS) $(LDFLAGS) -o $@
	$(TOOLPATH)objcopy.exe $@ -O binary -I coff-h8300



clean:
	rm *.o *.boot

