LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

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

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


Hi,

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:

http://basepath.com/aup/compile.htm

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:

Code:
[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]$
THANKS!!!!!!!
 
Old 11-15-2004, 05:16 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

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


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



Cheers,
Tink
 
Old 11-16-2004, 12:06 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
WOW
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
make
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, 02:09 AM   #4
Scrag
Member
 
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, 10:24 PM   #5
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
hey,
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 shell.sh in the top dir (from instructions)
set path top line in shell.sh to top dir
export OS=LINUX
export LIBS="-lncurses -lutil"
export TLIBS="-pthread"
./shell.sh c1 (repeat c1-c9 and common)
cd ./common
cp *.h ../c1 (repeat c1-c9)
cd ../include
cp *.h ../c1 (repeat c1-c9 and common)
ok
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
Code:
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
 
  


Reply


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 04:23 PM
Using sample C++ code from a book...won't compile Baix Programming 4 03-05-2005 03:04 PM
I cannot compile my souce code created by Glade on redhat9 msramachandran Programming 0 06-02-2004 03:13 AM
Help - rm souce code kilaabe Linux - General 1 11-14-2003 09:22 PM
Compile problem with souce code neilcpp Linux - Software 3 10-18-2003 02:53 PM


All times are GMT -5. The time now is 04:12 PM.

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