#************************************************************************
#       -= SEER - C-Scripting engine v 0.93a =-
#State      : under implementation
#Author     : Przemyslaw Podsiadly
#             email: ppodsiad@elka.pw.edu.pl
#             WWW:   http://home.elka.pw.edu.pl/~ppodsiad
#File:makefile
#Desc:makefile for library, compiler and tester
#************************************************************************/
.PHONY: release debug install uninstall clean intro test done 

all:release compiler install done
RM=rm
ALLMASK=*

Make=/usr/bin/make
System=Linux=1

Rebuild=


clean:intro yes.txt;@echo "Cleaning objs"; $(RM) objs/linux/$(ALLMASK) <yes.txt >nul; $(RM) yes.txt

uninstall:intro yes.txt;@echo -n "Cleaning all created files"; $(RM) objs$(ALLMASK) <yes.txt >nul; $(RM) bin$(ALLMASK) <yes.txt >nul; $(RM) lib$(ALLMASK) <yes.txt >nul; $(RM) examples\*.cs <yes.txt >nul; $(RM) examples\e*.exe <yes.txt >nul; $(RM) examples\*.o <yes.txt >nul; $(RM) yes.txt ; echo "."

release:;@echo =-------=======Compiling release library...======---------=; /usr/bin/make -fmakefile.all Optimize=1 OBJ_PATH=objs/linux $(Rebuild) $(System)

debug:;@echo =-------=======Compiling debug library...======---------=; $(Make) -fmakefile.all Debug=1 Test=1 OBJ_PATH=objs/linux $(Rebuild) $(System)

test:;@echo =-------=======Compiling test library...======---------=; $(Make) -fmakefile.all Debug=1 Test=1 OBJ_PATH=objs/linux $(Rebuild) $(System)
#Optimize=1

compiler:;@echo =-------=======Compiling SeeRC...======---------=; $(Make) -fmakefile.all Compiler=1 Optimize=1 SeeRC=1 OBJ_PATH=objs/linux $(Rebuild) $(System)

# NOTE : changed for bastard :)
LIBDEST = ../../lib/libseer.a
INCDEST = ../../include/seer.h
#LIBDEST = /usr/local/lib/libseer.a
#INCDEST = /usr/local/include/seer.h
#DOCDEST = /usr/info/seer.info someday

install: installing $(LIBDEST) $(INCDEST);@ echo Done.
$(LIBDEST):lib/libseer.a;@cp lib/libseer.a $(LIBDEST)
$(INCDEST):seer.h;@cp seer.h $(INCDEST)

installing:;@echo Installing SeeR library to $(LIBDEST)

intro:;@ echo "p----------=====Makefile for SeeR=====---------------q"; echo "| all,release,debug,compiler,install,clean,uninstall |"; echo "|   default is all(release,compiler and install)     |"
#echo Makefile for Seer>log

yes.txt:;@ echo y >yes.txt; echo t >>yes.txt

done:;@ echo "          ALL DONE."; echo "  SeeR library was successfully compiled and installed.";  echo " How to use SeeR, see examples in examples directory"; echo " and read seer.txt and readme.txt"; echo " Shortly:#include <seer.h> and link with libseer.a"; echo " Example command line: gcc foobar.c -o foobar.exe -lseer"; echo "        Have Fun!"
