# $Id: makefile,v 1.6 2003/07/17 13:30:50 ysato Exp $

CC = h8300-elf-gcc
LIBGCC = $(shell $(CC) --print-libgcc-file-name -mh -mint32|sed s/libgcc.a//)
OBJCOPY = h8300-elf-objcopy

INCLUDE=$(TARGET)/install/include/
CFLAGS = -I$(INCLUDE) -nostdlib -mh -mint32 -O2 -Os -g
LIBECOS = $(TARGET)/install/lib

ifdef VERBOSE
CFLAGS += -DVERBOSE
endif

inflate_boot.bin : inflate_boot
	$(OBJCOPY) -Obinary $< $@

inflate_boot.mot : inflate_boot
	$(OBJCOPY) -Osrec $< $@

inflate_boot : inflate_main.o makefile inflate_boot.ld
	$(CC) $(CFLAGS) -Tinflate_boot.ld -L$(LIBECOS) -L$(LIBGCC) -o$@ $<

clean:
	rm inflate_boot *.o *.bin

.PHONY: clean
