#* --------------------------------------------------------------------*/
#*    Copyright (c) 1992-1998 by Manuel Serrano. All rights reserved.  */
#*                                                                     */
#*                                     ,--^,                           */
#*                               _ ___/ /|/                            */
#*                           ,;'( )__, ) '                             */
#*                          ;;  //   L__.                              */
#*                          '   \   /  '                               */
#*                               ^   ^                                 */
#*                                                                     */
#*                                                                     */
#*    This program is distributed in the hope that it will be useful.  */
#*    Use and copying of this software and preparation of derivative   */
#*    works based upon this software are permitted, so long as the     */
#*    following conditions are met:                                    */
#*           o credit to the authors is acknowledged following         */
#*             current academic behaviour                              */
#*           o no fees or compensation are charged for use, copies,    */
#*             or access to this software                              */
#*           o this copyright notice is included intact.               */
#*      This software is made available AS IS, and no warranty is made */
#*      about the software or its performance.                         */
#*                                                                     */
#*      Bug descriptions, use reports, comments or suggestions are     */
#*      welcome. Send them to                                          */
#*        Manuel Serrano -- Manuel.Serrano@unice.fr                    */
#*-------------------------------------------------------------------- */
#*=====================================================================*/
#*    serrano/prgm/project/bigloo/gc-forward/Makefile                  */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Wed Jan 14 15:43:12 1998                          */
#*    Last change :  Thu Jan 15 09:10:46 1998 (serrano)                */
#*    -------------------------------------------------------------    */
#*    The small Makefile to build the forward GC library               */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*    flags                                                            */
#*---------------------------------------------------------------------*/
BIN		= ../../bin
BIGLOO		= $(BIN)/bigloo
BGLOPTFLAGS	= -O +rm
BFLAGS		= $(BGLOPTFLAGS)
CC 		= gcc
LD		= ld
LDFLAGS		= 
LDSHAREOPT	= -G

#*---------------------------------------------------------------------*/
#*    Objects and sources                                              */
#*---------------------------------------------------------------------*/
#*--- c ---------------------------------------------------------------*/
C_FILE		= forward

C_OBJ		= $(C_FILE:%=%.o)
C_SRC		= $(C_OBJ:%.o=%.c)

#*---------------------------------------------------------------------*/
#*    All objects and sources                                          */
#*---------------------------------------------------------------------*/
OBJ		= $(C_OBJ) $(SCM_OBJ)
SRC		= $(C_SRC) $(SCM_SRC)

POPULATION	= $(SRC) Makefile

#*---------------------------------------------------------------------*/
#*    the goals.                                                       */
#*---------------------------------------------------------------------*/
gc.a: libgc.a

libgc.a: $(OBJ)
	@ ar qcv libgc.a $(OBJ)

libgc.so:
	@ $(LD) $(LDSHAREOPT) -o libgc.so $(OBJ)

pop:
	@ echo $(POPULATION:%=gc-forward/%)

clean:
	@ find . \( -name '*[~%]'                   \
                       -o -name '.??*[~%]'          \
                       -o -name '#*#'               \
                       -o -name '?*#'               \
                       -o -name \*core \)           \
                     -type f -exec rm {} \;   
	@- \rm -f $(OBJ)
	@- \rm -f libgc.a libgc.so

#*---------------------------------------------------------------------*/
#*    distrib                                                          */
#*---------------------------------------------------------------------*/
distrib:
	@ if [ `pwd` = $$HOME/prgm/project/bigloo/gc-forward ]; then \
             echo "*** ERROR:Illegal dir to make a distrib `pwd`";   \
             exit 1;                                                 \
          fi
	@ $(MAKE) clean
	@ $(BIN)/copyright $(POPULATION)

#*---------------------------------------------------------------------*/
#*    Suffixes                                                         */
#*---------------------------------------------------------------------*/
.SUFFIXES:
.SUFFIXES: .c .o

#*---------------------------------------------------------------------*/
#*    .c.o                                                             */
#*---------------------------------------------------------------------*/
.c.o:
	@ echo $*.c:
	@ $(CC) -c $(CFLAGS) $*.c -o $*.o
