# eu_idu/Makefile
# Copyright (C) 2001 - 2003 Michael Riepe <michael@stud.uni-hannover.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

# @(#) $Id: Makefile,v 1.14 2003/04/12 17:15:22 michael Exp $

PACKAGE = f-cpu
VERSION = 0.000

srcdir = .
top_srcdir = ..

topdir = ..
subdir = eu_idu

confdir = $(topdir)/configuration
commondir = $(topdir)/common

CONF = $(confdir)/f-cpu_config.vhdl
COMMON = $(commondir)/bit_manipulation.vhdl \
	$(commondir)/generic_adder.vhdl
SRCS = idiv64.vhdl idiv64_test1.vhdl idiv64_test2.vhdl
DISTFILES = $(SRCS) Makefile
TESTBENCHES = idiv64_test1 idiv64_test2

VHDLP = vhdlp -strict
VHDLE = vhdle
WORKLIB = -work $(topdir)/work

default:;@echo >&2 'No default target!'; exit 1

all:
	$(VHDLP) $(WORKLIB) $(SRCS)

test: clean analyze simulate

analyze:
	$(VHDLP) $(CONF) $(COMMON) $(SRCS)

simulate:
	x="$(TESTBENCHES)"; for x in $$x; do \
		$(VHDLE) $$x || exit 1; \
	done

clean:
	rm -rf work.sym

distdir = $(PACKAGE)-$(VERSION)
distsubdir = $(topdir)/$(distdir)/$(subdir)

$(distsubdir):
	mkdir $@

dist: $(DISTFILES) $(distsubdir)
	file="$(DISTFILES)"; \
	for file in $$file; do \
		ln $(srcdir)/$$file $(distsubdir) || \
			cp -p $(srcdir)/$$file $(distsubdir) || exit 1; \
	done
