There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
UNIX/Linux
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > UNIX/Linux >
makefile


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
icecubeflower's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2007
29-Sep-2007, 01:28 AM #1
makefile
I have problems modifying a makefile. I have the classic gears.c program for openGL. It also has an SDLgears.c for SDL so the makefile compiles both .c files and makes two executables. If I open Makefile.am I cannot change anything without ruining make. Even if I change nothing. I can delete one character and replace it making the file exactly as it was and still make quits working. It always says:

bash-3.1# make
cd . && automake --foreign --include-deps Makefile
configure.in:9: warning: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1723: AC_CANONICAL_TARGET is expanded from...
configure.in:9: the top level
Makefile.am: required file `./depcomp' not found
make: *** [Makefile.in] Error 1

Then if I overwrite the new saved Makefile.am with an old copy of Makefile.am it works again. All I am using is Kedit or Mousepad text editor. I am changing nothing in the file and still it gives me the above error. Why?
lotuseclat79's Avatar
Distinguished Member with 10,007 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
29-Sep-2007, 05:38 PM #2
Hi icecubeflower,

Welcome to TSG!

It looks like you do not have a simple Makefile by itself, but are using the templates that generate the Makefile which actually builds the executable code.

What software package did you download from where as there are different versions of the gears program floating around the Internet. Is there a Readme or Install file that came with the download? Did you run ./configure first.

Why do you need to edit the the templates? Are there instructions you are following? What do they say?

Here is link to Introduction to GNU Build Tools which may shed some light on what you need to know.

Is there no simple Makefile (without any suffix: .in or .am) available with the distribution? Are you required to use the Build Tools to set up a project?

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction between a mere artisan or specialist and a real seeker after truth. - Einstein wrote in 1944.

Some say knowledge is power, I say knowledge without action is powerless. - lotuseclat79

Don't confuse action with movement. - Hemingway to Gardner

Imagination is more important than knowledge. - Einstein
icecubeflower's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2007
30-Sep-2007, 02:08 AM #3
This is where I got the original SDLgears tar file:

http://www.libsdl.org/opengl/index.php

I run ./configure and then I run make and everything works fine.

But doesn't a text editor leave everything unchanged? I mean every byte I see in a text editor should be saved as is, shouldn't it? If I use microsoft word or something it would do special formatting to the file that I can't see. But if I use a simple text editor I should see every byte.

So suppose my makefile.am looks like this:

EXTRA_DIST = \
autogen.sh gears.c

bin_PROGRAMS = SDLgears gears

SDLgears_LDADD = @GL_LIBS@
gears_LDADD = @GLUT_LIBS@

If I delete any character and then replace it exactly the way it was and then save it, I can no longer use make because it gives me the errors I mentioned before. I don't see why, because I am not changing makefile.am at all. (well, obviously I am, I just don't see how)

Also my goal wasn't to open makefile.am, change nothing and save it. I wanted to modify it and I kept getting errors. So I narrowed it down to the fact that just merely saving the file with a text editor causes the error even if I change nothing.
lotuseclat79's Avatar
Distinguished Member with 10,007 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
30-Sep-2007, 12:22 PM #4
Hi icecubeflower,

Never, ever use MS Word to edit Makefiles. WYSINWYG - i.e. What you see is NOT what you get! This is because software such as MS Word underneath the skin saves every edit ever made to the .doc since its creation. When you used MS Word and saved it under the mistaken impression that you were saving "What you see is what you get" - nothing could be further from the truth. That is why in court cases .doc documents have been used as evidence to examine the changes to a document. Of course there are exceptions and that data can be stripped out of the MS Word document, thus destroying its historical edits, but you really have to know what you are doing to accomplish that.

When in Linux/Unix and editing a text file such as a Makefile use gedit - then you should be able to validate your changes under WYSIWYG! :-)

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction between a mere artisan or specialist and a real seeker after truth. - Einstein wrote in 1944.

Some say knowledge is power, I say knowledge without action is powerless. - lotuseclat79

Don't confuse action with movement. - Hemingway to Gardner

Imagination is more important than knowledge. - Einstein
icecubeflower's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2007
30-Sep-2007, 02:13 PM #5
No, that's what I was saying. I did NOT use MS word because I know it does special formatting that I can't see. I used KEdit. I thought KEdit would leave the file intact but it didn't.

I will try gedit.

But I think KEdit is also a text editor so I don't see why it messed up the file.

Thanks.
icecubeflower's Avatar
Junior Member with 4 posts.
 
Join Date: Sep 2007
30-Sep-2007, 04:44 PM #6
kedit
I don't have gedit. I don't see why I can't use kedit, it's just a text editor. If I look at properties for the makefile.am file in KDE desktop, the changed file is exactly like the old one. The only thing that's changed is that after saving it in Kedit the owner is changed from 501 - 1000 to root - root. I don't know if that has anything to do with it.

Also besides Kedit I tried the Kdevelop C++ editor and I still have the same problem.
lotuseclat79's Avatar
Distinguished Member with 10,007 posts.
 
Join Date: Sep 2003
Location: -71.45091, 42.27841
01-Oct-2007, 08:56 AM #7
Have you tried vi or vim text editors? Look at the man pages for vi and vim.

Looks like you edited as root user instead of regular kubuntu user. That would account for why the ownership was changed.

To determine if there are any differences, save the original file first by copying it to another file name.

Then check out the byte count of the files: ls -lt file1 file2
If the byte counts are different then you know for sure they are difference

To really find out how difference issute the command: diff file1 file2
which will list the differences

-- Tom
__________________
The independence created by philosophical insight is - in my opinion - the mark of distinction between a mere artisan or specialist and a real seeker after truth. - Einstein wrote in 1944.

Some say knowledge is power, I say knowledge without action is powerless. - lotuseclat79

Don't confuse action with movement. - Hemingway to Gardner

Imagination is more important than knowledge. - Einstein
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 12:37 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.