#* --------------------------------------------------------------------*/
#*    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/examples/Foreign/Makefile            */
#*    -------------------------------------------------------------    */
#*    Author      :  Manuel Serrano                                    */
#*    Creation    :  Thu Sep 16 15:05:03 1993                          */
#*    Last change :  Wed Jan 14 15:57:25 1998 (serrano)                */
#*    -------------------------------------------------------------    */
#*    The Makefile to build the foreign example.                       */
#*=====================================================================*/

#*---------------------------------------------------------------------*/
#*    flags                                                            */
#*---------------------------------------------------------------------*/
BIN		= ../../bin
BIGLOO		= $(BIN)/bigloo
BGLOPTFLAGS	= -O +rm
CC              = gcc
BFLAGS          = -v
CFLAGS	 	= -I.

POPULATION	= examples/Foreign/Makefile examples/Foreign/README \
                  examples/Foreign/el.c examples/Foreign/el.h       \
                  examples/Foreign/foreign.scm examples/Foreign/foreign2.scm

#*---------------------------------------------------------------------*/
#*    foreign                                                          */
#*---------------------------------------------------------------------*/
foreign: foreign.o foreign2.o el.o
	@ $(BIGLOO) $(BFLAGS) foreign.o foreign2.o el.o

foreign.o: el.o foreign2.o
	@ $(BIGLOO) $(BFLAGS) foreign.scm el.o -c

foreign2.o: foreign2.scm
	@ $(BIGLOO) $(BFLAGS) foreign2.scm -c

el.o: el.c
	@ echo el.c:
	@ $(CC) $(CFLAGS) -c el.c

test: foreign
	$(DEST)

pop:
	@ echo $(POPULATION)

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