# This software is a part of NOODLYBOX.
# This software is distributed under the terms of the new BSD License.
# Copyright (c) 2008, molelord
# All rights reserved.

.PHONY : all clean depend

ifeq ($(shell uname -o), Msys)
    DOTEXE=.exe
    # Replace /?/ by ?:/
    COLON_NOODLYBOX_HOME:=$(shell echo $(NOODLYBOX_HOME) | sed -e 's,^/\(.\)/,\1:/,')
else
    DOTEXE=
    COLON_NOODLYBOX_HOME:=$(NOODLYBOX_HOME)
endif

FUSEFLAGS=


%_PKG.vhd : %.vhd
	compo.rb $< > $@

%.vhd : %.xaw
	xaw2vhdl $< -intstyle silent $@
	rm -f $*_arwz.ucf xaw2vhdl.log
	mimic.rb $@

%.v : %.xaw
	xaw2verilog $< -intstyle silent $@
	rm -f $*_arwz.ucf xaw2vhdl.log
	mimic.rb $@

%.c : %.csv
	accessor.rb -c $< > $@

%.h : %.csv
	accessor.rb -h $< > $@

%$(DOTEXE) : %.prj
	fuse $(FUSEFLAGS) -intstyle xflow -nodebug -incremental \
        -prj $< -top $* -o $@
