Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 11-15-2004, 01:24 PM   #1
Registered: Mar 2004
Location: Wisconsin
Distribution: Kali Linux
Posts: 122

Rep: Reputation: 15
Trying to compile souce code that came with AUP book....


I cant seem to be able to compile the soucecode correctly for the book I purchased "Advanced Unix Programming" by Marc Rochkind. I read the directions for this at:

but.....I dont really understand the directions, and dont know where to go from here. Any suggestions, I guess I just am looking for a simplified explination for a noob like me to get this running. The path I have the AUP code located is: /home/scrag/C/AUP and the DIR looks like this:

[scrag@localhost AUP]$ ls
aup2ex.tar.gz  c2/  c4/  c6/  c8/  common/   include/  makebuild.awk*  README*
c1/            c3/  c5/  c7/  c9/  defs.h~*  make      Makefile        ux/
[scrag@localhost AUP]$
Old 11-15-2004, 04:16 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Sorry mate, but without an actual problem... :)

Which bits of info in that document did you not
understand/could you not follow?

Old 11-15-2004, 11:06 PM   #3
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
that's a singular testamony to the brilliance/insanity of unix makefile systems
and the total unportability of old unix code
basically that ain't ever gonna work
this is what i did
to compile the stuff
copy the *.h files in common and include into c1-c9 copy *.h from include into common
hack /common/makebuild.spec so the line !echo CFLAGS = is blank after the "=" all that stuff is bad
make the shell script like the instructions say and chmod 755 on it
run that shell script that runs the awk script that proccesses the makebuild.spec file -- over and over with c1-c9 and common directories as argument
so now i cd into ./c1 and run make
fails at
make: *** No rule to make target `/common/macrostr.c', needed by `macrostr.o'. Stop.
cd ../common
fails with
make: *** No rule to make target `/common/macrostr.c', needed by `macrostr.o'. Stop.
gcc -c -o macrostr.o macrostr.c
and now the rub -- a million errors from the file macrostr.incl
look at macrostr.incl
what the &*^$ is that crap /???????
i have no idea
i give up
like so many UNIX programming books
this stuff needs to be ported to Linux before you can see what the heck it is.
Old 11-16-2004, 01:09 AM   #4
Registered: Mar 2004
Location: Wisconsin
Distribution: Kali Linux
Posts: 122

Original Poster
Rep: Reputation: 15
Well, thanks for the effort! I finally got my soucecode for my other book "Unix network programming" working after messing with it all day, guess i'll read that one instead
Old 11-16-2004, 09:24 PM   #5
Senior Member
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
i tried this again and got it to work
think i left out the shell variable exports before
steps (hope i don't leave anything out)
put makebuild.awk and what i called in the top dir (from instructions)
set path top line in to top dir
export OS=LINUX
export LIBS="-lncurses -lutil"
export TLIBS="-pthread"
./ c1 (repeat c1-c9 and common)
cd ./common
cp *.h ../c1 (repeat c1-c9)
cd ../include
cp *.h ../c1 (repeat c1-c9 and common)
cd ./c1
make and it fails
make: *** No rule to make target `/common/macrostr.c', needed by `macrostr.o'. Stop
like before
so you have to hack the Makefile in each directory including common
they have
macrostr.o: $(AUPSRC)/common/macrostr.c $(AUPSRC)/common/macrostr.incl
	$(CC) $(CFLAGS) -c  -o $*.o $(AUPSRC)/common/macrostr.c
notice all the rest of the entries have the real path not the variable $(AUPSRC)
just replace $(AUPSRC) with the real path in each one and it works
it appears the crazy author has left you some stupid syntax errors in the code on purpose just to be cleaver teacher but they are easy to fix.

sorry i hade wrong pronouncement before -- not the first time i've ever been wrong

now i will look at this code it looks kind of interesting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Iwlist souce code David_Moses Linux - Software 2 04-07-2005 03:23 PM
Using sample C++ code from a book...won't compile Baix Programming 4 03-05-2005 02:04 PM
I cannot compile my souce code created by Glade on redhat9 msramachandran Programming 0 06-02-2004 02:13 AM
Help - rm souce code kilaabe Linux - General 1 11-14-2003 08:22 PM
Compile problem with souce code neilcpp Linux - Software 3 10-18-2003 01:53 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:26 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration