hackw@comphy.PHYSICS.ORST.EDU (Warren Hack) (08/09/90)
I have been working with Sozobon under gulam and ran into a couple of questions that I need some help on. Since the NET is one of the best sources of info around, I was hoping some programmers a little more expert in using Sozobon and gulam could answer a couple of questions for me. First, I have a program originally written in ANSI standard C on Turbo C that has 13 .c files with it. I have set up a rudimentary .g file to compile them but would rather use the make facility for later work. Could someone provide me a simple example of a makefile for me to pattern my own after. Second, one of the files does not want to compile. When compiled by itself with the -S option, the compiler gives 2 bombs. This file only has printf, some scanf's and an occasional atoi() in it. Any suggestions as to what I might look for to get this compiled. Any help will be appreciated and if requested, I will forward answers I receive to those who also want them personally. --Warren J. Hack hackw@comphy.physics.orst.edu
hackw@comphy.PHYSICS.ORST.EDU (Warren Hack) (08/09/90)
Well, learning C can be a humbling experience and I beg your indulgences for part of my first posting. I still need help with makefiles, but I found the error that caused Sozobon heartaches. My program had pointer arrays which were static yet were not declared static and I just can not see why Sozobon did not like it. :-) :-). I now hope others learning to work with C learn from my experience as I have. --Warren J. Hack hackw@comphy.physics.orst.edu
steve@thelake.mn.org (Steve Yelvington) (08/09/90)
[In article <19755@orstcs.CS.ORST.EDU>, hackw@comphy.PHYSICS.ORST.EDU (Warren Hack) writes ... ] > I have been working with Sozobon under gulam and ran into a couple of > questions that I need some help on. Since the NET is one of the best > sources of info around, I was hoping some programmers a little more expert > in using Sozobon and gulam could answer a couple of questions for me. > > First, I have a program originally written in ANSI standard C on Turbo C > that has 13 .c files with it. Watch out: Sozobon is not an ANSI compiler. > I have set up a rudimentary .g file to > compile them but would rather use the make facility for later work. Could > someone provide me a simple example of a makefile for me to pattern my > own after. This is a common problem, which is why I followed up with a posting instead of e-mail. The make program is picky about tabs. Do not replace them with spaces. The format is: final_form:<tab>list of its constitutent parts <tab>command to make the final form from the parts <tab>more optional lines of commands String variables that work like environment variables can be defined at the top of the makefile, then plugged into the lines that describe how files are related. Here is an example makefile. The bottom two lines are generic. The entries for post060.zoo and post060.uue demonstrate how make can manage programs other than a compiler. (I'm also using make to manage a documentation project in which the chapters are stored in individual files.) ------- # change OBJECTS and PROGRAM as needed # LIBS defines extra libraries that should be linked -- AESFAST, for instance # CC is predefined. OBJECTS=postnews.o enterlin.o PROGRAM=postnews.ttp CFLAGS=-v -O LIBS=c:\sozobon\lib\dlibuu post060.uue: post060.zoo uue post060.zoo post060.zoo: postnews.ttp zoo a post060.zoo postnews.ttp $(PROGRAM): $(OBJECTS) $(CC) $(CFLAGS) -o $(PROGRAM) $(OBJECTS) $(LIBS) -- Steve Yelvington at the (rain-replenished) lake in Minnesota steve@thelake.mn.org