cc = gcc
CHIP_TYPE = tas2563
CFLAGS = -Wall -DPDM_ENABLE -DI2C_ENABLE -I inc \
			-I inc/coef \
			-I inc/prm_reg \
			-I ../inc	\
			-I ../../inc
#unused-variable
prom_ram = $(CHIP_TYPE)_mcu
deps_ram = $(shell find . -maxdepth 3 -name "*.h") \
		$(shell find ../inc -maxdepth 1 -name "*.h")	\
		$(shell find ../../inc -maxdepth 1 -name "*.h")
src_ram = $(shell find . -maxdepth 1 -name "*.c")	\
		$(shell find .. -maxdepth 1 -name "*.c")	\
		$(shell find ../.. -maxdepth 1 -name "*.c")
bak_ram =  $(shell find . -maxdepth 1 -name "*.bak")	\
		$(shell find .. -maxdepth 1 -name "*.bak")	\
		$(shell find ../.. -maxdepth 1 -name "*.bak")
obj_ram = $(src_ram:%.c=%.o)

all : $(prom_ram)
.PHONY : all

$(prom_ram): $(obj_ram)
	$(cc) -o $(prom_ram) $(obj_ram) -lm

%.o: %.c $(deps_ram)
	$(cc) $(CFLAGS) -c $< -o $@

.PHONY:clean
clean:
	rm -f $(prom_ram) $(obj_ram) $(bak_ram)