#
# This file is part of the Alliance CAD System
# Copyright (C) Laboratoire LIP6 - Dpartement ASIM
# Universite Pierre et Marie Curie
# 
# Home page          : http://www-asim.lip6.fr/alliance/
# E-mail support     : mailto:alliance-support@asim.lip6.fr
# 
# This progam 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.
# 
# Alliance VLSI  CAD System  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 the GNU C Library; see the  file COPYING. If not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#

# makefile for vti logical and physical views
# version : 4.9
# date    : 23/06/93
# slight modification to include the TARGET_LIB directory
# Frederic Petrot

include $(TOP)/etc/$(MACHINE).mk
include $(TOP)/etc/libraries.mk

VERSION     = 5.0
RCSSOURCES  = Makefile \
              drive_vti_l.c \
              drive_vti_p.c \
              parse_vti_l.c \
              drive_vti_l.h \
              drive_vti_p.h \
              parse_vti_p.c
PH_OBJ      = drive_vti_p.o parse_vti_p.o
LO_OBJ      = drive_vti_l.o parse_vti_l.o

MCL_LIB      = libMcl410.a
MCP_LIB      = libMcp405.a
MCL_H        = mcl410.h
MCP_H        = mcp405.h

LOCAL_FLAGS = -O4 -I$(ALLIANCE_INCLUDE)\
              -DMLU_H='"$(MLU_H)"' \
              -DMPU_H='"$(MPU_H)"' \
              -DMLO_H='"$(MLO_H)"' \
              -DMPH_H='"$(MPH_H)"' \
              -DMUT_H='"$(MUT_H)"' \
              -DRCN_H='<$(RCN_H)>'

all: $(TARGET_LIB)/$(MCP_LIB) $(TARGET_LIB)/$(MCL_LIB) \
     $(TARGET_INCLUDE)/$(MCP_H) $(TARGET_INCLUDE)/$(MCL_H)

$(TARGET_INCLUDE)/$(MCP_H): $(MCP_H)
	$(CP) $? $@

$(TARGET_INCLUDE)/$(MCL_H): $(MCL_H)
	$(CP) $? $@

$(TARGET_LIB)/$(MCP_LIB) : $(PH_OBJ)
	$(AR) $(ARFLAGS) $(TARGET_LIB)/$(MCP_LIB) $(PH_OBJ)
	$(RANLIB) $(TARGET_LIB)/$(MCP_LIB)

$(TARGET_LIB)/$(MCL_LIB) : $(LO_OBJ)
	$(AR) $(ARFLAGS) $(TARGET_LIB)/$(MCL_LIB) $(LO_OBJ)
	$(RANLIB) $(TARGET_LIB)/$(MCL_LIB)

parse_vti_l.o : parse_vti_l.c
	$(CC) $(CFLAGS) $(LOCAL_FLAGS) -c parse_vti_l.c 

parse_vti_p.o : parse_vti_p.c
	$(CC) $(CFLAGS) $(LOCAL_FLAGS) -c parse_vti_p.c

drive_vti_l.o : drive_vti_l.c
	$(CC) $(CFLAGS) $(LOCAL_FLAGS) -DTECHNO='"idps_symb"' -c drive_vti_l.c

drive_vti_p.o : drive_vti_p.c
	$(CC) $(CFLAGS) $(LOCAL_FLAGS) -DTECHNO='"idps_symb"' -c drive_vti_p.c

checkin : 
	echo "y" > 1
	for i in $(RCSSOURCES); do \
		ci -l$(VERSION) -f -m"rcs version number consistency" $$i < 1 ; \
	done
	tail +7 Makefile | head -6 > ./RCS/rcs$(VERSION)
	-$(RM) 1

clean :
	-@$(RM) $(PH_OBJ) $(LO_OBJ) > /dev/null 2>&1

realclean: clean
	-@$(RM) $(TARGET_LIB)/$(MCP_LIB) $(TARGET_LIB)/$(MCL_LIB) > /dev/null 2>&1
