
CC = mipsel-unknown-elf-gcc
LD = mipsel-unknown-elf-ld
DU = mipsel-unknown-elf-objdump

APP_NAME = ocean

OBJS = laplacalc.o \
       jacobcalc.o \
       jacobcalc2.o \
       linkup.o \
       multi.o \
       slave1.o \
       slave2.o \
       subblock.o \
       main.o

LIBS = -L../../build/libs -luser -lmath

INCLUDES = -I.  -I../..  -I../../giet_libs  -I../../giet_xml  

LIB_DEPS = ../../build/libs/libuser.a  ../../build/libmath.a

CFLAGS := -O2 -g -Wall -fomit-frame-pointer -mno-gpopt -fno-delete-null-pointer-checks 

# building rules

.PHONY: clean

appli.elf: $(OBJS) $(APP_NAME).ld $(LIBS_DEPS) $(APP_NAME).py
	$(LD) -o $@ -T $(APP_NAME).ld $(OBJS) $(LIBS)
	$(DU) -D $@ > $@.txt

%.o: %.c decs.h
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<

clean:
	rm -f *.o *.elf *.txt *.pyc core *~
