Makefile relinks everytime


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Makefile relinks everytime
# 1  
Old 06-08-2005
Makefile relinks everytime

Hi guys, I'm a firsttime poster. My makefile is relinking everytime, even if nothing changes. Is there anyway to have it stop doing this?

Here the makefile:
Code:

F77C    = /usr/bin/f77 -O
VERSION =9.4
VPATH = ../poten
# executables that can be built from this makefile

OH3S  = ../exe/poly.oh3.serial.exe  

OBJ = dattim.o dateclock.o givtst.o intbsv3.o poly40.o \
polyrr.o headr.o interface.o polysz.o ef.o \
hooks.o ivtstm.o polyag.o rtpjac.o \
energetics.o intbsv1.o main.o acespoly.o \
polyhl.o fromblas.o intbsv2.o poly31.o polymq.o dummy_mpi.o

POT:../poten/oh3.f

.f.o:
        $(F77C) -c $<
.c.o:
        cc -c $<

OH3S:$(OBJ) dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o
        $(F77C) -o $(OH3S) $(OBJ) dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o

And here is the interactive output when I run it:

/usr/bin/f77 -O -o ../exe/poly9.4.oh3.serial.exe dattim.o dateclock.o givtst.o intbsv3.o poly40.o polyrr.o headr.o interface.o polysz.o ef.o hooks.o ivtstm.o polyag.o rtpjac.o energetics.o intbsv1.o main.o acespoly.o polyhl.o fromblas.o intbsv2.o poly31.o polymq.o dummy_mpi.o dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o


Everything is working fine, I just want to get it to stop relinking even when nothing changes. Thanks!

Last edited by Perderabo; 06-13-2005 at 07:25 AM.. Reason: Add code tags for readability
# 2  
Old 06-13-2005
One reason might me that the time stamp of your source files is greater than the generated object files. In such a case, every time the make utility will assume that object files are older as compaired to source file.

In such case, Change the time stamp of all the relavent source files using touch command.

This should solve your problem.
# 3  
Old 06-13-2005
This line is improbable:
OH3S:$(OBJ) dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o

maybe it should be:
$(OH3S):$(OBJ) dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o

but it's hard to say for sure with such a messy makefile. I really don't know what this line is supposed to be for:
POT:../poten/oh3.f

but as near as I can tell it exerts no influence over the final result. I guess it might do something if you invoke make with "make POT". But that would not yield the result you give.
# 4  
Old 06-13-2005
The time stamps are fine

The source files are older than the objects, and the objects are older than the executable. Is there any other reason that Make would relink?
# 5  
Old 06-13-2005
Quote:
Originally Posted by bellings
The source files are older than the objects, and the objects are older than the executable. Is there any other reason that Make would relink?
See this post. Smilie
# 6  
Old 06-13-2005
This line is correct:
OH3S:$(OBJ) dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o

Yes, the purpose for this line:
POT:../poten/oh3.f
is for 'Make POT'.

But why is it relinking?
# 7  
Old 06-13-2005
That line claims to make a file called OH3S but probably doesn't. Would it really kill you to try changing it to:
$(OH3S)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Epoch time to produce exact date everytime

so i have to perform a certain task at set times. for instance, i need to run a job at 12:30am every night, and other jobs, i only need to have them run on saturdays. how do i manipulate the date command to give me the epoch equivalence of what 12:30am would be every day? im looking for a... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

Ksh: Test UNIX command without $? everytime

Hello all, working on Solaris 10 in ksh. Basicly, in my function, i'm trying to test that all my unix cmd's are true (exit status 0) else you flag the rcControlRule to 1 without going into spagetti mode code testing every $? in a if statement. The mdb is probably a little tricky cause it... (3 Replies)
Discussion started by: maverick72
3 Replies

3. Shell Programming and Scripting

To move multiple files to a new folder everytime

Hi , Below is the scenario A.txt B.txt C.csv .......... i want to move all the above files in to a new path & new folder .This folder is created based on date(for ex: today's fodler name will be 20120222).for Everyday move a new folder based on date has to be created & this folder... (1 Reply)
Discussion started by: jagadeeshn04
1 Replies

4. Shell Programming and Scripting

executing a shell script everytime the terminal is opened

the problem statement is Write a shell script, which gets executed the moment the user opens a terminal. It should display the message "Hello your_name, welcome to 172.16.4.120 server” How to get around this? (2 Replies)
Discussion started by: arindamlive
2 Replies

5. Homework & Coursework Questions

Help with Simple Multi-Level Makefile (Extremely New at Makefile)

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Basically, the prompt is make a makefile with various sub makefiles in their respective subdirectories. All code... (1 Reply)
Discussion started by: Tatl
1 Replies

6. UNIX for Dummies Questions & Answers

Script run everytime a new terminal window is opened

I created a script called title #!/bin/sh echo "^0;$*^G" It will change the terminal window titlebar to what ever I type after the script (title BIG would change titlebar to BIG instead of terminal) Is there a way to make it run so it will work on every terminal window that gets opened.... (1 Reply)
Discussion started by: amason0508
1 Replies

7. Solaris

How to start in a bash shell everytime I logon to SunOS?

Hi I logon to sunos boxes at work that starts in a ksh shell. I would like to login to a bash shell whenever I logon to the sunos boxes instead of having to login and type bash . I tried editing the .profile and added SHELL= usr/bin/bash however when I login I am still in the ksh shell. I... (4 Replies)
Discussion started by: Esa
4 Replies

8. UNIX for Advanced & Expert Users

Makefile problem - How to run module load in a Makefile

Hi, I'm trying to run the module load command in a Makefile and i'm getting the following error: make: module: command not found Why is this? Is there any way to run this command in a Makefile? NOTE: command - module load msjava/sunjdk/1.5.0 works fine outside of the Makefile (2 Replies)
Discussion started by: hernandinho
2 Replies

9. UNIX for Dummies Questions & Answers

Why does my webserver stop everytime I exit my session?

Hi, We have a webserver which runs on our unix server, we had to stop it for some work to be carried out, and restarted it earlier this week. I'm logging in as myself and then root and starting the webserver as follows: cd /etc/init.d ./northgate.web start this starts it up fine,... (6 Replies)
Discussion started by: kenny123m
6 Replies

10. Shell Programming and Scripting

Need to run source .bashrc everytime

hi all, I've included some variables in my .bashrc file. But everytime i'm logging in i need to source my .bashrc file to make effect of my variables. i'm having an account on a highly secured production environment. I've the following in my ~/.bashrc file alias cls=clear How to make... (2 Replies)
Discussion started by: kalyanraj
2 Replies
Login or Register to Ask a Question