#############################################################################
##
#W  Makefile                    GAP source                       Frank Celler
##
#H  @(#)$Id: Makefile.in,v 1.5 1999/07/01 15:32:24 gap Exp $
##
#Y  Copyright (C)  1997,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
##
##  This file is the top level make file.  It is generated from `Makefile.in'
##  by the `configure' script.  After unpacking XGAP you simply type
##
##    ./configure
##
##  to create a make file and then
##
##    make
##
##  to compile and link XGAP.
##
##  The "default" traget:
##    - creates a subdirectory CPU-VENDOR-OS in the directory `bin',
##    - copies the configuration script into this directory,
##    - it switches into this directory and executes the configure script,
##    - it makes XGAP in this directory.
##
##  The "clean" target:
##    - removes the subdirectory CPU-VENDOR-OS in the directory `bin'
##    - removes any files created by `configure'
##
SHELL=/bin/sh
CC=i586-mandriva-linux-gnu-gcc


default: config compile

config: bin/i386/configure bin/i386/Makefile

bin/i386/configure: cnf/configure.out
	if test ! -d bin;  then mkdir bin;  fi
	if test ! -d bin/i386;  then mkdir bin/i386;  fi
	@rm -f bin/i386/configure
	cp cnf/configure.out bin/i386/configure

bin/i386/Makefile: bin/i386/configure cnf/config.hin
	( cd bin/i386 ; CC=$(CC) ./configure --target=i586-mandriva-linux-gnu i586-mandriva-linux-gnu --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --x-includes=/usr/include --x-libraries=/usr/lib )

compile: bin/i386/configure bin/i386/Makefile
	( cd bin/i386 ; $(MAKE) CC=$(CC) )
	chmod +x xgap.sh
	cp xgap.sh bin/xgap.sh

clean:
	rm -rf bin/i386
	rm -f xgap.sh bin/xgap.sh
	rm -f config.cache config.log config.status Makefile
