PROG  = userprog

LANG  = C

all:	clean  boot.o  $(PROG).o
	sh-hms-gcc -m2 -nostartfiles -Wl,-t \
	    -o $(PROG).out boot.o $(PROG).o   -Tldscript.x \
	    -Xlinker -Map $(PROG).map
	sh-hms-objcopy -O srec $(PROG).out $(PROG).sr

boot.o: boot.c
	sh-hms-gcc -c -g -m2 boot.c -o boot.o

$(PROG).o: $(PROG).c bios.c
	sh-hms-gcc -c -g -m2 $(PROG).c -o $(PROG).o

clean:
	rm -f boot.o $(PROG).o \
	    $(PROG).out $(PROG).sr $(PROG).map
	touch $(PROG).map
