.key file/a

; Created 28-05-91 by TetiSoft
; TetiSoft = Detlef Wuerkner, Werrastr. 7, D-6300 Giessen, Germany
;
; Batch file to link a C program that is NOT split in multiple files
;
; Usage: link filename (.o will be added)
;
; Without 1.3 Shell or if script bit not set or if called from a batchfile,
; use: Execute HCC:s/link filename
;
; If you want to link split programs, you must create your own batch file
; See for example HCC-Source:Source/HCC/HCC.with
; (Call it like: BLink with HCC.with)


; The object files produced by HCC, TOP and A68k can be linked either
; with HCC.o          and HCC.lib   (use of CClib.library) or
; with Astartup.obj   and amiga.lib (use of amiga.lib) or
; with HCC.o, HCC.lib AND amiga.lib (use of both).
;
; IN ALL THIS CASES YOU MUST USE THE -L FLAG OF HCC (32 bit ints).
;
; If you really need 16 bit ints you will have to rebuild HCC.lib
; to expect int args as 16 bit or use another C library.
;
; amiga.lib always expects 32 bit args, the only exception is printf() etc
; which uses RawDoFmt() (%d is 16 bit, %ld is 32 bit).
;
; Of course, you could use 16 bit ints in your program and cast every parameter
; passed to a library function to be long. But I know you WILL forget the
; casting sometimes... use the -L flag, it's safer.

; Astartup.obj and amiga.lib can be found on the Commodore Includes&AutoDocs
; disks. See file ReadMe how to get them.
; If BLink crashes when using amiga.lib, use ALink instead (also on this disks)
; ALink uses a different command syntax. You must change 'SC SD VERBOSE'
; to 'SMALL' or nothing.

; If you use HCC.o, the CLI/Shell window will remain open after
; run >nil: prog
; endcli
; Tests with RunBack resulted in an immediately terminating program.
; I think CClib.library is the reason of that. If you really need programs
; that run in the background without a CLI/Shell window, you must link
; with AStartup.obj and amiga.lib


; If you do not have amiga.lib and BLink doesn't find a function, look at
; Include:functions.h (=Include:proto/all.h) if the missing function is really
; in 1.3 amiga.lib


; Choose one of the following four versions:
;-------------------------------------------

; Version 1: CClib.library only
;------------------------------
; Use this if you do not need amiga.lib (or if you don't have it)
; You can remove the 'LIB:Stubs.lib' if you never use Amiga-specific features
BLink LIB:HCC.o+<file>.o LIB LIB:HCC.lib+LIB:Stubs.lib TO <file> SC SD VERBOSE

; Version 2: CClib.library and amiga.lib
;---------------------------------------
; Use this if you need something from amiga.lib (e.g. CreatePort() )
;BLink LIB:HCC.o+<file>.o LIB LIB:HCC.lib+LIB:Stubs.lib+LIB:amiga.lib TO <file> SC SD VERBOSE

; Version 3: CClib.library and amiga.lib when using CreateTask() (not tested)
;----------------------------------------------------------------------------
; Use this if you want to use CreateTask() from amiga.lib
;	( CreateTask() in 1.3 amiga.lib uses A6 as local stack pointer.
;	  Since the stub routines in HCC.lib destroy A6, the stub routines
;	  from amiga.lib must be used. )
;BLink LIB:HCC.o+<file>.o LIB LIB:HCC.lib+LIB:amiga.lib TO <file> SC SD VERBOSE

; Version 4: amiga.lib only
;--------------------------
; Use this if you never use a function from CClib.library
; or if you want to use the stdio functions from amiga.lib
; ( fgetc() and getchar() from 1.3 amiga.lib also use A6 as local stack pointer,
;   see above )
;BLink LIB:AStartup.obj+<file>.o LIB LIB:amiga.lib TO <file> SC SD VERBOSE

List <file>
