@echo off

REM Version 1.2                                                1997/1/10
REM
REM tutorial.bat : This file is part of the alliance 3.0 patch for OS/2 & WIN32
REM
REM Copyright (C) 1996 Christoph Jaeschke, jaeschke@item.uni-bremen.de
REM
REM This program is free software; you can redistribute it and/or modify
REM it under the terms of the GNU General Public License as published by
REM the Free Software Foundation; either version 2 of the License, or
REM (at your option) any later version.
REM 
REM This program is distributed in the hope that it will be useful,
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
REM GNU General Public License for more details.
REM 
REM You should have received a copy of the GNU General Public License
REM along with this program; if not, write to the Free Software
REM Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

REM
REM *************** Script to patch the tutorial makefiles**********************
REM arguments %1 : emx or cyg

if "%1" == "cyg" goto paramOK
if "%1" == "emx" goto paramOK
echo Specify on of [EMX,CYG]
goto end
:paramOK
touch \alliance\tutorials\patch.started
cd \alliance\tutorials
echo *** Changing tutorial-makefiles, adding Top, Machine and include %1.mk,
echo *** removing SHELL=
REM switching to cmos_5.rds
REM echo w sed.log> sed.tmp
echo 1i\> sed.tmp
echo TOP=/alliance\>> sed.tmp
echo MACHINE=%1\>> sed.tmp
echo include $(TOP)/etc/$(MACHINE).mk>> sed.tmp
echo /SHELL *=/d>> sed.tmp
echo /TOP *=/d>> sed.tmp
echo s!dplib/ecpd10!dplib!>> sed.tmp
echo s!/bin/rm!rm!>> sed.tmp
echo s!/dev/null!nul!>> sed.tmp
REM echo s!prol10!cmos_5!>> sed.tmp
echo s!ALLIANCE_BIN *=.*!ALLIANCE_BIN = $(TOP)/archi/$(MACHINE)/bin!>> sed.tmp
echo s!FITPATH_BIN *=.*!FITPATH_BIN = $(TOP)/archi/$(MACHINE)/bin!>> sed.tmp
echo s!USER_BIN *=.*!USER_BIN = $(TOP)/archi/$(MACHINE)/bin!>> sed.tmp
echo s!DPR_BIN *=.*!DPR_BIN = $(TOP)/archi/$(MACHINE)/bin!>> sed.tmp

cd \alliance\tutorials\addaccu
echo processing addaccu...
IF NOT EXIST Makefile.org copy Makefile Makefile.org
SED -f ..\sed.tmp  < Makefile.org > Makefile
cd \alliance\tutorials\alligator
echo processing alligator...
IF NOT EXIST Makefile.org copy Makefile Makefile.org
SED -f ..\sed.tmp  < Makefile.org > Makefile
cd \alliance\tutorials\amd2901
echo processing amd2901...
IF NOT EXIST Makefile.org copy Makefile Makefile.org
SED -f ..\sed.tmp  < Makefile.org > Makefile
cd \alliance\tutorials\dlxm
echo processing dlxm...
IF NOT EXIST Makefile.org copy Makefile Makefile.org
SED -f ..\sed.tmp  < Makefile.org > Makefile
cd \alliance\tutorials\fitpath
echo processing fitpath...
IF NOT EXIST Makefile.org copy Makefile Makefile.org
SED -f ..\sed.tmp  < Makefile.org > Makefile
cd \alliance\tutorials\synthesis_tools
echo processing synthesis_tools...
IF NOT EXIST Makefile.org copy Makefile Makefile.org
SED -f ..\sed.tmp  < Makefile.org > Makefile
del ..\sed.tmp
cd \alliance\patch
touch \alliance\tutorials\patch.finished
:end
