#REGCONV      := regconv
REGCONV      := /bin/true

DEF_FILES    := foo1_struct.def foo2_struct.def foo3_struct.def foo4_struct.def foo5_struct.def
HEADER_FILES := $(DEF_FILES:%.def=%.h)


all: $(HEADER_FILES)

setup:
	touch $(DEF_FILES)

####################################################################################################
#
# Generic rule describing how to generate a foo_struct.h file from a foo_struct.def file
#
%_struct.h: %_struct.def
	$(eval CHIPNAME := $(shell echo $* | tr a-z A-Z))
ifdef VERBOSE
	$(REGCONV) -chipname $(CHIPNAME) $< -simout $@
else
#	$(info Creating regconv header file CHIPNAME=$(CHIPNAME): $(notdir $@))
	@echo Creating regconv header file CHIPNAME=$(CHIPNAME): $(notdir $@)
	@$(REGCONV) -chipname $(CHIPNAME) $< -simout $@
endif
