#here clear EXTRA_CFLAGS to permit it expand multitimes by submake
EXTRA_CFLAGS :=
TOPDIR?=$(CURDIR)/../../../bin/
src=$(TOPDIR)
export obj?=$(CURDIR)/build

export LOADADDR=0xffffffff80200000
export COMBASE=0xffffffffbfe80000

EXTRA_CFLAGS := $(CFLAGS_EXTRA) -DCOM1_BASE_ADDR=$(COMBASE) -D_KERNEL -DLOADADDR=$(LOADADDR) -I$(CURDIR) -I$(CURDIR)/include  -I$(TOPDIR)/include -I$(TOPDIR)/include/mips -DCONFIG_BAUDRATE=115200 -DCPU_COUNT_PER_US=400  -save-temps=obj
export CROSS_COMPILE=/opt/gcc-4.9.3-64-gnu/bin/mips64el-linux-

all:
	make guess.elf64
asm-offsets.c:
	touch asm-offsets.c

clean:
	rm -rf asm-offsets.c *.lds *.s *.s64 *.o *.o64 *.i *.a *.elf *.elf64 map.txt build libtiny64
	cd $(obj) && rm -f *.o *.a *.s *.o64 *.O *.O64 *.elf *.elf64 *.ELF64 *.lds *.bin *.bin64 *.i *.i64 *.a *.s *.s64 map.txt $(src)/include/asm/asm-offsets64.h $(src)/include/asm/asm-offsets32.h
	cd $(obj) && rm -rf lib*
guess-objs = start.o guess.o
guess-libs = tinyc


include $(TOPDIR)/elfrules.make
