#
# 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.
#

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


LOCAL_INC = -I$(ALLIANCE_INCLUDE)

LOCAL_CFLAGS    = $(CFLAGS) $(LOCAL_INC) \
                  -DALLIANCE_VERSION='"$(ALLIANCE_VERSION)"' \
                  -DMUT_H='<$(MUT_H)>' \
                  -DMLU_H='<$(MLU_H)>' \
                  -DMPU_H='<$(MPU_H)>' \
                  -DMLO_H='<$(MLO_H)>' \
                  -DBEH_H='<$(BEH_H)>' \
                  -DINF_H='<$(INF_H)>' \
                  -DELP_H='<$(ELP_H)>' \
                  -DCNS_H='<$(CNS_H)>' \
                  -DFCL_H='<$(FCL_H)>' \
                  -DYAG_H='<$(YAG_H)>' \
                  -DRCN_H='<$(RCN_H)>' \
                  -DTEL_H='<$(TEL_H)>' \
                  -DTRC_H='<$(TRC_H)>' \
                  -DTTV_H='<$(TTV_H)>' \
                  -DTAS_H='"$(TAS_H)"' \
                  -DMPH_H='"$(MPH_H)"'


LOCAL_LIB  = -L$(ALLIANCE_LIB) \
	$(ELP_L)\
	$(RTL_L)\
	$(RPR_L)\
	$(RDS_L)\
	$(ICU_L)\
	$(ICC_L)\
	$(ICA_L)\
	$(ICN_L)\
	$(MGN_L)\
	$(MPU_L)\
	$(MMG_L)\
	$(MCP_L)\
	$(MAP_L)\
	$(MPH_L)\
	$(MLU_L)\
	$(MVL_L)\
	$(MSL_L)\
	$(MHL_L)\
	$(MGL_L)\
	$(MEL_L)\
	$(MCL_L)\
	$(MAL_L)\
	$(RCN_L)\
	$(MLO_L)\
	$(BVL_L)\
	$(BHL_L)\
	$(BEH_L)\
	$(MUT_L)

.c.o :
	$(CC) $(LOCAL_CFLAGS) -c $<

BIN = $(TARGET_BIN)/x2y $(TARGET_BIN)/flatlo $(TARGET_BIN)/flatph

all : $(BIN)
	@echo "######################################### all done."

$(TARGET_BIN)/x2y : x2y.o
	$(CC) $(LOCAL_CFLAGS) -o $@ $< $(LOCAL_LIB)

$(TARGET_BIN)/flatlo : flatlo.o
	$(CC) $(LOCAL_CFLAGS) -o $@ $< $(LOCAL_LIB)

$(TARGET_BIN)/flatph : flatph.o
	$(CC) $(LOCAL_CFLAGS) -o $@ $< $(LOCAL_LIB)

realclean : clean
	$(RM) -f $(TARGET_BIN)/x2y
	$(RM) -f $(TARGET_BIN)/flatlo
	$(RM) -f $(TARGET_BIN)/flatph

clean :
	$(RM) -f *.bak .*.bak *~ .*~ core 
	$(RM) -f x2y.o flatlo.o flatph.o
