top_builddir = ../../..
ee = $(top_builddir)/ee

CC 	= mips64r5900-unknown-elf-gcc
AR	= mips64r5900-unknown-elf-ar
CCLD 	= $(CC)
CFLAGS 	= -g -O2
DEFS 	= -I. -I$(top_builddir)/include -I$(ee)/include

COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS)
LINK = $(CCLD) $(LDFLAGS) -o $@

SUBDIR = 

all: npmputs.elf

.c.o:
	$(COMPILE) -c $<

.s.o:
	$(COMPILE) -c $<

.S.o:
	$(COMPILE) -c $<

LDFLAGS = -L$(ee)/lib -Wl,-Ttext=0x100000
LDADD =  -lkernel -lc -lm

OBJECTS = npmputs.o

npmputs.elf: $(OBJECTS)
	$(LINK) $^ $(LDFLAGS) $(LDADD) -o $@

clean:
	rm -f *o *bak *elf
