[net.micro.atari16] How to compile PC Hack

rwb@druxu.UUCP (BlackR) (06/18/86)

I, too, have been able to get PC HACK to compile and run on the 520/1040
ST computers.  As the .ttp file is 270K bytes, I am not enthusiastic
about posting it to the net and am looking for alternate ways of
distributing it.

Until that is accomplished, here is one way to compile and link it.  I
used the Lattice C compiler on a 1 Meg system with one single sided
drive.

To compile: create a 512K RAM disk and copy to it the following files:
	* the compiler (lc.ttp, lc1.ttp, lc2.ttp)
	* compiler header files (stdio.h, setjmp.h, osbind.h)
	* PC HACK header files (*.h) in a folder (call it headers.fld)
	* the source file (*.c), four at a time (compile four, copy the
		.bin files, remove both .c and .bin files, copy four
		more, etc)
	* an editor (if needed)
I found that the sources used most of two disks.  Furthermore, the .bin
files used something more than 1 disk.  Consequently, the strategy is to
copy a .c file to the RAM disk, compile it, copy the .bin file to
another disk, and erase the .c and .bin from the RAM disk.  The command
to the compiler I used is (leave off lc if invoking lc from the desktop):
	lc -n -iheaders.fld\ <file>
Pack as many .bin files on a disk as possible.  I found that all files
alphabetically before u_init.bin fit on one disk.  The total time to
compile all files without having to edit to correct problems was around
2 hours.

To link: after you have generated two disks containing .bin files, you
are ready to link.  Create a file called hack.lnk containing the linker
directives.  It should be modelled after c.lnk, but expand the body to
include all the .bin files you compiled above (instead of taking the
command line).  Here the strategy is to copy the first disk of .bin
files (the one that is full) to the RAM disk and place the second disk
on the drive, writting the .ttp file to the drive; thus, each .bin file
on the second disk should be referenced in the .lnk file as b:name.bin.
Resize the RAM disk to 435K (this is the smallest I could make it and still
fit everything on it, leaving the rest of the RAM for the linker).  Copy
to the RAM disk the following:
	* the linker (link.ttp)
	* the libraries (clib.bin and startup.lib)
	* the all the .bin files from the first disk
	* the hack.lnk file
Run the linker with the following command line (leave off link if
invoked from the desktop):
	link -with hack -nolist -prog b:hack.ttp
After 15 minutes (if all has gone well), you should have an executable
file on drive b.

WARNING: the source files will not compile (nor will the .ttp file run)
without modifications.  In particular, the files have to be adapted for
the Lattice C compiler and for the Atari terminal emulator. 
Furthermore, there are problems with the compiler (e.g. the strncpy
library routine has a problem, the compiler generates some code that
can't handle certain pointer arithmetic properly, etc.).  I will shortly
post a list of problems I have discovered.  If you start with the MS-DOS
version, be prepared to spend considerable time in just getting the
compiler and linker to work and then in debugging the code.

Rodney Black
AT&T Information Systems
Denver, CO 80234
druxu!rwb

ab@unido.UUCP (06/22/86)

/***** unido:net.micro.at16 / druxu!rwb /  7:09 pm  Jun 18, 1986*/
[...]
To link: after you have generated two disks containing .bin files, you
are ready to link.  Create a file called hack.lnk containing the linker
directives.  It should be modelled after c.lnk, but expand the body to
include all the .bin files you compiled above (instead of taking the
command line).  Here the strategy is to copy the first disk of .bin
files (the one that is full) to the RAM disk and place the second disk
on the drive, writting the .ttp file to the drive; thus, each .bin file
on the second disk should be referenced in the .lnk file as b:name.bin.
Resize the RAM disk to 435K (this is the smallest I could make it and still
fit everything on it, leaving the rest of the RAM for the linker).  Copy
to the RAM disk the following:
	* the linker (link.ttp)
	* the libraries (clib.bin and startup.lib)
	* the all the .bin files from the first disk
	* the hack.lnk file
Run the linker with the following command line (leave off link if
invoked from the desktop):
	link -with hack -nolist -prog b:hack.ttp
After 15 minutes (if all has gone well), you should have an executable
file on drive b.
[...]
/* ---------- */

I found out that if you arrange the program output to go to the ram disk
and keep all other files  except the library on normal disk, you can link
hack within 6 minutes.

	Andreas Bormann
	University of Dortmund  [UniDo]
	West Germany

Uucp:   ab@unido.uucp
Path:   {USA}!seismo!{mcvax}!unido!ab
	{Europe}!{cernvax,diku,enea,ircam,mcvax,prlb2,tuvie,ukc}!unido!ab
Bitnet: ab@unido.bitnet (==  ab@ddoinf6.bitnet)
		      \
F-111 bombers:    -=>-->-*>     N 51 29' 05"    E 07 24' 42"
		      /