include $(NOODLYBOX_HOME)/etc/makerule

DIRS=msimv icarusv msim

.PRECIOUS : $(foreach X, $(DIRS), $(X)/makefile $(X)/makefile.depend)

all : verilog

clean :
	-rm -rf $(DIRS)

verilog : msimproj-verilog icarusproj-verilog

vhdl : msimproj-vhdl

testprogram :
	cd c && $(MAKE)

%/makefile : %_makefile
	mkdir -p $(@D)
	cp $< $@

%/makefile : %v_makefile
	mkdir -p $(@D)
	cp $< $@

%/makefile.depend : %/makefile
	cd $(<D) && $(MAKE) depend

%proj-vhdl : %/makefile.depend
	cd $(<D) && $(MAKE)

%proj-verilog : %v/makefile.depend
	cd $(<D) && $(MAKE)
