📄 createeoproject.sh
字号:
#! /bin/tcsh -f## Script to create a completely new EO project from templates## Originally by Marc Schoenauer# Copyright (C) 2006 Jochen K黳per <jochen@fhi-berlin.mpg.de>if ($PWD:t != Templates) then echo "You must start this shell script from the EO Template directory" exitendifif ($#argv < 1) then echo "Usage: $0 ApplicationName [TargetDirName]" echo " This will create ../TargetDirName if necessary (default dir name = ApplicationName)," echo " and will also put all the files there that are strictly necessary to compile and run" echo " your application." exitendif# we're going to do somethingecho " "if ($#argv == 1) then set TargetDir = /tmp/$1else set TargetDir = /tmp/$2endifif ( -d $TargetDir ) then echo "Warning: The target directory does exist already." echo -n "Overwrite (yes/no)? " set REP = $< if ($REP != "yes") then echo "Stopping, nothing done!" exit endifelse if ( -e $TargetDir ) then echo "Warning: $TargetDir exist but isn't a directory." echo "Stopping, nothing done!" exitendifmkdir -p $TargetDir/src# creating filesecho "Creating source files for application $1 in $TargetDir/src"sed s/MyStruct/$1/g eoMyStruct.tmpl > $TargetDir/src/eo$1.hsed s/MyStruct/$1/g init.tmpl > $TargetDir/src/eo$1Init.hsed s/MyStruct/$1/g stat.tmpl > $TargetDir/src/eo$1Stat.hsed s/MyStruct/$1/g evalFunc.tmpl > $TargetDir/src/eo$1EvalFunc.hsed s/MyStruct/$1/g mutation.tmpl > $TargetDir/src/eo$1Mutation.hsed s/MyStruct/$1/g quadCrossover.tmpl > $TargetDir/src/eo$1QuadCrossover.hsed s/MyStruct/$1/g MyStructSEA.cpp > $TargetDir/src/$1EA.cppecho "Creating build-support files for application $1 in $TargetDir"sed s/MyStruct/$1/g configure.ac.tmpl > $TargetDir/configure.acsed s/MyStruct/$1/g Makefile.am.top-tmpl > $TargetDir/Makefile.amsed s/MyStruct/$1/g Makefile.am.src-tmpl > $TargetDir/src/Makefile.amsed s/MyStruct/$1/g README.tmpl > $TargetDir/READMEtouch $TargetDir/AUTHORStouch $TargetDir/COPYINGtouch $TargetDir/ChangeLogtouch $TargetDir/INSTALLtouch $TargetDir/NEWSecho "Successfully created project $1 in $TargetDir!"echo "Start building the new project"# building new projectcd $TargetDiraclocal || exitautoheader || exitautomake --add-missing --copy --force-missing --gnu || exitautoconf || exit./configure || exitmake || exit# doneecho ""echo "Project $1 successfully build in $TargetDir!"echo "Implement your code and enjoy."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -