Codebase list unrtf / debian/0.19.3-1.1 build.amiga
debian/0.19.3-1.1

Tree @debian/0.19.3-1.1 (Download .tar.gz)

build.amiga @debian/0.19.3-1.1raw · history · blame

.KEY CLEAR/S,INSTALL/S,MAKE/S,UNINSTALL/S
.BRA {
.KET }
;------------------------------------------------------------------------------
;  UnRTF, a command-line program to convert RTF documents to other formats.
;  Copyright (C) 2000,2001 Zachary Thayer Smith
;
;  This program is free software; you can redistribute it and/or modify
;  it under the terms of the GNU General Public License as published by
;  the Free Software Foundation; either version 2 of the License, or
;  (at your option) any later version.
;
;  This program is distributed in the hope that it will be useful,
;  but WITHOUT ANY WARRANTY; without even the implied warranty of
;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;  GNU General Public License for more details.
;
;  You should have received a copy of the GNU General Public License
;  along with this program; if not, write to the Free Software
;  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
;
;  The author is reachable by electronic mail at tuorfa@yahoo.com.
;------------------------------------------------------------------------------
; Author name:    Lars Unger <l.unger@tu-bs.de>
; Create date:    15 Aug 01
; Last change:    16 Aug 01
; Purpose:        AmigaDOS batch file to build GNU UnRTF using GNU GCC
;
;Version
;$VER: build.amiga 0.4
;------------------------------------------------------------------------------
;
;
; definitions (feel free to modify)
;
set GCC "gnu:bin/gccv"
set CFLAGS "-g -Wall"
set OBJS "convert.o word.o entity.o error.o main.o hash.o parse.o special.o malloc.o attr.o util.o"
set CSRC "convert.c word.c entity.c error.c main.c hash.c parse.c special.c malloc.c attr.c util.c"
set TARGET "unrtf"
set BINARY "C:unrtf"
set HELP "HELP:english/unrtf"
;
; end of definitions
;
; gcc installed ?
if not exists $GCC
 echo ERROR: $GCC not found !
 quit 20
endif
; action control switch
set BUILDAMIGA NO
; delete old gcc run
if "{CLEAR}" EQ "CLEAR"
 set BUILDAMIGA YES
 delete #?.o >NIL:
 delete $TRAGET >NIL:
endif
; uninstall unrtfl
if "{UNINSTALL}" EQ "UNINSTALL"
 set BUILDAMIGA YES
 delete $BINARY >NIL:
 delete $HELP all >NIL:
endif
; install unrtf
if "{INSTALL}" EQ "INSTALL"
 set BUILDAMIGA YES
 ask "Install unrtf in $BINARY ?"
 if warn
  if exists $TARGET
   copy $TARGET $BINARY
   echo "Installed $TARGET in $BINARY"
  else
   echo "ERROR: No unrtf executable found !"
  endif
 endif
 ask "Install unrtf docs in $HELP ?"
 if warn
  if not exists $HELP
   makedir $HELP
  endif
  copy unrtf.guide changes todo readme $HELP >NIL:
 endif
endif
; use gccv to create unrtf executable (compile)
if "{MAKE}" EQ "MAKE"
 set BUILDAMIGA YES
 ; set stack for gcc
 if exists env:GCCSTACK
  stack $GCCSTACK
 else
  stack 250000
 endif
 ; compile source file(s)
 $GCC $CFLAGS -c $CSRC
 ; link objects
 $GCC -o $TARGET $OBJS
 ; check output
 if exists $TARGET
  protect $TARGET +e
  echo "$TARGET was created and is executable. Maybe you"
  echo "have to increase the stack size of your shell.  "
  echo "Have fun !"
 else
  echo "ERROR: unrtf executable not found !"
  echo "Please check output from GCC."
 endif
endif
; any action performed otherwise give help
if $BUILDAMIGA EQ NO
 echo "This is an AmigaDOS batch file to build unrtf using GCC"
 echo "Using: build.amiga CLEAR/S,INSTALL/S,MAKE/S,UNINSTALL/S"
endif