[net.micro.amiga] my C development disk setup

keithe@tekgvs.UUCP (Keith Ericson) (09/13/86)

[ I know this may not be useful to you more experienced Amiga-ites  ]
[ out there, but for those of us still struggling to make our Amiga ]
[ into something useful I think this will be a welcome posting.     ]

I've come up with what I think is a pretty decent way of getting
C-programs developed, compiled and running, thanks in No Small Part
to the net.micro.amiga and mod.amiga contributors (special mention
to Fred Fish and Matt Dillon).

Anyway, here's what my df0: looks like:
in the root there are the directories c, l, devs, s, t, fonts, libs

directory c contains
Alink		cc		cd		copy		
date		delete		dir		diskcopy		
echo		ed		else		endcli		
endif		execute		failat*		fault*		
format		if		info		join		
kermit		lab*		lc1		lc2		
list		make		makedir		newcli		
objdump*	omd*		quit		read*		
rename		romwack*	run		search		
shell		skip*		snoop*		stack		
wait*		wc		why		

Note that lc2 - among others - is missing.

(The ones marked with an asterisk - I've never used them explicitly
But I know some are use in scripts and others are just waiting for
me to learn how to use them. By the way - what _is_ snoop?)

directory l contains
Disk-Validator	Port-Handler	Ram-Handler

Quite frankly I don't know what these do but I keep them around
'cause they sound neat :-).

directory devs contains
printers (dir)
parallel.device		printer.device
serial.device		system-configuration

	sub-directoy printers contains
	diablo_630	epson		epson_jx-80
	generic		okimate_20

	(These are the only printers out of the original list that
	I would ever expect to use. In fact, I could discard all but
	the epson but - since my Amiga is at work and I have access
	to more printers - I kept more than I really needed.)

directory s contains
.kermrc		.login		Startup-Sequence

directory t is nominally empty

directory fonts is empty
	(I guess I should delete the directory, huh?)

directory libs contains
icon.library	info.library

(Maybe I could delete the icon.library, but, again, I'm not sure...)

That leaves me with the single file "now" in the root of df0;,
aka c-cli.

On the "generic" version of df1: I place the C Include directory
and the C library directory. I have several copies of this disk,
waiting for project sub-directories to contain program modules
and makefiles. 

Now let me tell you about the Big Win of this system: the make and
the cc programs - both from Fred Fish (well, the make was written
by Landon M. Dyer of Atari Inc. and "INCREDIBLY HACKED OVER" by
Eric C. Brown, University of Utah, and Fred Fish, UniSoft Systems Inc.
(for Commodore AMIGA).

The cc program saves you an amazing amount of typing! It searches
the ram:c/, df0:c/ and df1:c/ for the executables (lc1, lc2 and
alink). It searches the current directory, ram:include/, df0:include/
and df1:include/ for the include files; and the current directory,
ram:lib/, df0:/lib and df1:lib/ for the library files. And it
automagically supplies the following "options:"

	-ixxx:include/ -ixxx:include/lattice/  to the lc1 command
	Lstartup.obj file  to the list of object modules to be linked
	-lyyy:lib.lib and -lyyy:amiga.lib  to the linker command

(xxx: and yyy: are wherever it found the files)

(it calls alink - should be a simple mod to have it call blink when
I can get it...)

Now for the make facility - it's great, too. Once you learn the ins
and outs of building a make file. But with the capabilities of the
cc frontend make files get pretty simple: to wit, the one I used
to compile Matt's shell program:

#
# makefile to construct matt dillon's shell program using the
# cc c-compiler front end from fred fish.
#

#
# a "macro" to make life a little easier. I'm not sure this really
# saved anything in this case but a more complicated makefile might
# get better use out of it...
#
OBJS   = main.o  globals.o execom.o comm1.o comm2.o set.o sub.o

INCL   = shell.h

# note that you don't have to specify either the Lstartup.obj file
# in the list of files to be linked, or the lc.lib or amiga.lib
# libraries - cc does it for you. It seaches current-dir, ram:, df0:
# and df1: for the lib/ directory. Also, it knows to call the linker
# once the .o files are all available.

shell	: $(OBJS)
	cc -o shell $(OBJS)

# once again, note the work cc saves you: it automatically adds the
# :include/ and :include/lattice/ directories for include-file searches
# (and it looks in current-dir, ram:, df0: and df1: for the include
# directory)

#
# cc -c means "compile this and leave the object module for later use."
# Otherwise cc would try to compile _and_ link each individual file.
#
main.o	: main.c $(INCF)
	cc -c main.c

globals.o	: globals.c $(INCF)
	cc -c globals.c

execom.o	: execom.c $(INCF)
	cc -c execom.c

comm1.o	: comm1.c $(INCF)
	cc -c comm1.c

comm1.o	: comm2.c $(INCF)
	cc -c comm2.c

set.o	: set.c $(INCF)
	cc -c set.c

sub.o	: sub.c $(INCF)
	cc -c sub.c

#
# end of makefile
#


So there you have it - the contents of Keith's Simple C-Development
Toolkit. Hope this saves you some work.

keith


Keith Ericson  at TekLabs (resident factious factotum)
Tektronix, PO 500, MS 58-383         Beaverton OR 97077        (503)627-6042
uucp: [ucbvax|decvax|ihnp4|hplabs|(and_many_others)]!tektronix!tekgvs!keithe
CSnet: keithe%tekgvs@tektronix  ARPAnet: keithe%tekgvs%tektronix@csnet-relay

"Modern" version: keithe@tekgvs.tek.com