############################################################################
# Makefile for "convol" application running on ALMOS-MKH
############################################################################

-include ../../params-soft.mk

ifeq ($(ARCH_NAME),)
$(error Please define in ARCH_NAME parameter in params-soft.mk!)
endif

OBJS = build/convol.o

INCLUDES = -I.                      \
           -I$(LIBC_INCLUDE)        \
           -I$(LIBPTHREAD_INCLUDE)  \
           -I$(LIBALMOSMKH_INCLUDE) \
           -I$(SHARED_INCLUDE)      \
           -I$(HAL_INCLUDE)

compile: dirs build/convol.elf

build/convol.elf : $(OBJS) convol.ld
	$(LD) -o $@ -T convol.ld $(OBJS) -L$(LIBC) -L$(LIBPTHREAD) -L$(LIBALMOSMKH) \
         -lc -lpthread -lalmosmkh -lpthread -lc 
	$(DU) -D $@ > $@.txt

build/convol.o : convol.c
	$(CC) $(INCLUDES) $(CFLAGS) -c -o  $@ $<

dirs:
	@mkdir -p build/

clean:
	rm -rf build/*.o  build/*.elf  build/*.txt

.PHONY: dirs clean

