# /*------------------------------------------------------------\
# |                                                             |
# | This file is part of the Alliance CAD System Copyright      |
# | (C) Laboratoire LIP6 - Dpartement ASIM Universite P&M 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 Library 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.                     |
# |                                                             |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# |                                                             |
# | Tool   :                 Library Fks104                     |
# |                                                             |
# | File   :                    Makefile                        |
# |                                                             |
# | Author :                 Jacomme Ludovic                    |
# |                                                             |
# | Date   :                    28.10.94                        |
# |                                                             |
# \------------------------------------------------------------*/

include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk
include $(ALLIANCE_TOP)/etc/libraries.mk
include local.mk

# /*------------------------------------------------------------\
# |                                                             |
# |                            Variables                        |
# |                                                             |
# \------------------------------------------------------------*/

LOCAL_CFLAGS = $(CFLAGS)  -D$(ALLIANCE_OS)

# /*------------------------------------------------------------\
# |                                                             |
# |                             Include                         |
# |                                                             |
# \------------------------------------------------------------*/

LOCAL_INCLUDE = -I$(LOCAL_TARGET_INC) -I$(ALLIANCE_INCLUDE)

# /*------------------------------------------------------------\
# |                                                             |
# |                             Library                         |
# |                                                             |
# \------------------------------------------------------------*/
# /*------------------------------------------------------------\
# |                                                             |
# |                             Define                          |
# |                                                             |
# \------------------------------------------------------------*/

LOCAL_MBK_DEFINE = -DMUT_H='"$(MUT_H)"' \
                   -DAUT_H='"$(AUT_H)"' \
                   -DABL_H='"$(ABL_H)"' \
                   -DBDD_H='"$(BDD_H)"'

LOCAL_FSM_DEFINE = -DFSM_H='"$(FSM_H)"'

LOCAL_DEFINE = $(LOCAL_MBK_DEFINE) $(LOCAL_FSM_DEFINE)

LOCAL_HEADER = $(LOCAL_INCLUDE) $(LOCAL_DEFINE)

LOCAL_FKS_LIB    = libFks104.a
LOCAL_FKS_INC    = fks104.h

# /*------------------------------------------------------------\
# |                                                             |
# |                             Object                          |
# |                                                             |
# \------------------------------------------------------------*/

LOCAL_FKS_OBJ = fksparse.o fkserror.o fksdrive.o

LOCAL_OBJ = $(LOCAL_FKS_OBJ)

.c.o: $(LOCAL_TARGET_INC)/$(LOCAL_FKS_INC)
	$(CC) -c $(LOCAL_CFLAGS) $(LOCAL_HEADER) $<

# /*------------------------------------------------------------\
# |                                                             |
# |                         Library Fks                         |
# |                                                             |
# \------------------------------------------------------------*/

distrib : $(LOCAL_TARGET_INC)/$(LOCAL_FKS_INC) \
          $(LOCAL_TARGET_LIB)/$(LOCAL_FKS_LIB)

$(LOCAL_TARGET_INC)/$(LOCAL_FKS_INC) : $(LOCAL_FKS_INC)
	$(CP) $(LOCAL_FKS_INC) $(LOCAL_TARGET_INC)/$(LOCAL_FKS_INC)

$(LOCAL_TARGET_LIB)/$(LOCAL_FKS_LIB) : $(LOCAL_OBJ)
	$(AR) $(ARFLAGS) $(LOCAL_TARGET_LIB)/$(LOCAL_FKS_LIB) $(LOCAL_FKS_OBJ)
	$(RANLIB) $(LOCAL_TARGET_LIB)/$(LOCAL_FKS_LIB)

# /*------------------------------------------------------------\
# |                                                             |
# |                             Fks                             |
# |                                                             |
# \------------------------------------------------------------*/

fksparse.o : fksparse.c fksparse.h fkserror.h
fksdrive.o : fksdrive.c fksdrive.h fkserror.h
fkserror.o : fkserror.c fkserror.h

# /*------------------------------------------------------------\
# |                                                             |
# |                              Clean                          |
# |                                                             |
# \------------------------------------------------------------*/

clean :
	$(RM) -f $(LOCAL_OBJ)


# /*------------------------------------------------------------\
# |                                                             |
# |                          RealClean                          |
# |                                                             |
# \------------------------------------------------------------*/

realclean : clean
	$(RM) -f $(LOCAL_TARGET_LIB)/$(LOCAL_FKS_LIB) \
                 $(LOCAL_TARGET_INC)/$(LOCAL_FKS_INC)

# /*------------------------------------------------------------\
# |                                                             |
# |                          Clean Object                       |
# |                                                             |
# \------------------------------------------------------------*/

cleanobj :
	$(RM) -f $(LOCAL_OBJ) 
