Makefile relinks everytime


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Makefile relinks everytime
# 8  
Old 06-16-2005
I tried changing it to:
$(OH3S):$(OBJ) dummy_mpi.o oh3.o setup4.o surf4.o coord4.o chain4.o
but now it says that there is no rule when I 'gmake OH3S':
gmake: *** No rule to make target `OH3S'. Stop.
# 9  
Old 06-16-2005
And it's right. You have variables and targets mixed up. You want to make a file called george? You use the command:
make george
You don't use "make fred".

In your case, do you want to make a file called OH3S or do you want to make a file called ../exe/poly.oh3.serial.exe. Depending on which it is, do one of these:
make ../exe/poly.oh3.serial.exe
make OH3S

Your "make POT" will redo the commands each time as well. I doubt that it creates a file called POT.

Try leaving my change in and adding, near the top, certainly as the first rule:

OH3S:$(OH3S)
# 10  
Old 06-17-2005
It almost works

Thanks for the help. Just one more thing. When I make the executable, it only works if I make it in exactly the way that it appears in the Makefile. So if I type "gmake ../exe/poly.oh3.serial.exe" it works. But if I try to make the file by typing the absolute path and not the relative path, it doesn't work. Is there any way to use absolute and relative paths with Makefile?
# 11  
Old 06-17-2005
If you put the

OH3S:$(OH3S)

in then OH3S is both a variable and a target. And then your "gmake OH3S" should work again. At least I think so. I have never done that. I don't use gmake, but with plain old make, if you type the command:
make
(no target at all) it will look for the first target and make that. I gotta believe that gmake does that too. So by making
OH3S:$(OH3S)
the first line, it will be the default target. But must of us would do stuff like
default:$(OH3S)
to make it more clear to a reader. But whatever rule is first is the default.
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