#############################################################################
##
#W  Makefile                    GAP source                       Frank Celler
##
##
#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=gcc

GAParch=armv7l-unknown-linux-gnueabihf-gcc

default: config compile

config: bin/$(GAParch)/configure bin/$(GAParch)/Makefile

bin/$(GAParch)/configure: cnf/configure.out
	mkdir -p bin/$(GAParch)
	@rm -f bin/$(GAParch)/configure
	cp cnf/configure.out bin/$(GAParch)/configure

bin/$(GAParch)/Makefile: bin/$(GAParch)/configure cnf/config.hin
	( cd bin/$(GAParch) ; CC=$(CC) ./configure  )

compile: bin/$(GAParch)/configure bin/$(GAParch)/Makefile
	( cd bin/$(GAParch) ; $(MAKE) CC=$(CC) )
	cp xgap.sh bin/xgap.sh

clean:
	rm -rf bin/$(GAParch)
	rm -f xgap.sh bin/xgap.sh
	rm -f config.cache config.log config.status Makefile
