Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Makefiles and dependencies

 
Post new topic   Reply to topic Printable version
 View previous topic  What about D? Post :: Post PHP/SQL: Partial data :S  View next topic  
Author Message
Bak
?ls -s
0 in


Age:20
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon Sep 25, 2006 2:32 am    Post subject: Makefiles and dependencies Reply to topic Reply with quote

So I have a Makefile that has some dependencies:

Quote:
...

$(MODULE_OUTPUT_DIR)SS_Items.so: $(MODULE_DIR)Module.h $(MODULE_DIR)SS_Items/SS_Items.h $(MODULE_DIR)SS_Items/SS_Items.cpp
$(CC) $(MODULE_FLAGS) -I$(MODULE_DIR) -o $(MODULE_OUTPUT_DIR)SS_Items.so $(MODULE_DIR)SS_Items/SS_Items.cpp

...

$(MODULE_DIR)SS_Items/SS_Items.h: $(MODULE_DIR)SS_Items/Antiwarp.h $(MODULE_DIR)SS_Items/Brick.h $(MODULE_DIR)SS_Items/Cloak.h $(MODULE_DIR)SS_Items/Gun.h $(MODULE_DIR)SS_Items/Portal.h $(MODULE_DIR)SS_Items/Rocket.h $(MODULE_DIR)SS_Items/Thor.h $(MODULE_DIR)SS_Items/Bomb.h $(MODULE_DIR)SS_Items/Burst.h $(MODULE_DIR)SS_Items/Decoy.h $(MODULE_DIR)SS_Items/Mine.h $(MODULE_DIR)SS_Items/Repel.h $(MODULE_DIR)SS_Items/Stealth.h $(MODULE_DIR)SS_Items/XRadar.h

...


Then when I edit a file, let's say Gun.h, and do "make", it doesn't remake SS_Items.so. What gives?

Here's the relavent portion of the "make -d" log:

Quote:

Considering target file `../Modules/SS_Items/SS_Items.h'.

...

Considering target file `../Modules/SS_Items/Gun.h'.
Looking for an implicit rule for `../Modules/SS_Items/Gun.h'.
Trying pattern rule with stem `Gun.h'.
Trying implicit prerequisite `../Modules/SS_Items/Gun.h,v'.
Trying pattern rule with stem `Gun.h'.
Trying implicit prerequisite `../Modules/SS_Items/RCS/Gun.h,v'.
Trying pattern rule with stem `Gun.h'.
Trying implicit prerequisite `../Modules/SS_Items/RCS/Gun.h'.
Trying pattern rule with stem `Gun.h'.
Trying implicit prerequisite `../Modules/SS_Items/s.Gun.h'.
Trying pattern rule with stem `Gun.h'.
Trying implicit prerequisite `../Modules/SS_Items/SCCS/s.Gun.h'.
No implicit rule found for `../Modules/SS_Items/Gun.h'.
Finished prerequisites of target file `../Modules/SS_Items/Gun.h'.
No need to remake target `../Modules/SS_Items/Gun.h'.

...

Finished prerequisites of target file `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Antiwarp.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Brick.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Cloak.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Gun.h' is newer than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Portal.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Rocket.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Thor.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Bomb.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Burst.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Decoy.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Mine.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Repel.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/Stealth.h' is older than target `../Modules/SS_Items/SS_Items.h'.
Prerequisite `../Modules/SS_Items/XRadar.h' is older than target `../Modules/SS_Items/SS_Items.h'.
No commands for `../Modules/SS_Items/SS_Items.h' and no prerequisites actually changed.

No need to remake target `../Modules/SS_Items/SS_Items.h'.


Is there something I'm not getting about makefiles?
_________________
SubSpace Discretion: A Third Generation SubSpace Client


Last edited by Bak on Mon Sep 25, 2006 4:29 am, edited 1 time in total
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:36
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3606
Location: Las Vegas
Offline

PostPosted: Mon Sep 25, 2006 4:10 am    Post subject: Reply to topic Reply with quote

I don't write Makefiles very often. It is either a one-lined GCC command or I use autoconf/automake. But it looks to me like you don't actually have a command to update the file. You know, the following line, the thing it is complaining about? Thus, it knows the file needs to be updated, it just doesn't have anything to do it.
Back to top
View users profile Send private message Add User to Ignore List Send email
Bak
?ls -s
0 in


Age:20
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon Sep 25, 2006 4:28 am    Post subject: Reply to topic Reply with quote

But doesn't need to update the .h file, that's what programmers are for. The command is to build a .so file and I'm listing the dependencies. It's not complaining about anything, it just doesn't rebuild the .so file when I do "make"; I end up having to delete it before it relizes it needs to recompile it.

It seems to note that one of the dependencies of the file has changed, then proceeds to say that none of them have.

Oh mmm... I think I kinda see what you mean. What's the fix?
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Mine GO BOOM
Hunch Hunch
What What
Hunch Hunch<br>What What


Age:36
Gender:Gender:Male
Joined: Aug 01 2002
Posts: 3606
Location: Las Vegas
Offline

PostPosted: Mon Sep 25, 2006 5:29 am    Post subject: Reply to topic Reply with quote

Make it touch SS_Items.h or list all those things as dependencies of SS_Items.so. There is probably a better way, as I don't do makefiles often.
Back to top
View users profile Send private message Add User to Ignore List Send email
-Smong-
Guest


Offline

PostPosted: Mon Sep 25, 2006 8:14 am    Post subject: Reply to topic Reply with quote

Mine GO BOOM wrote:
list all those things as dependencies of SS_Items.so.
That's the way I would do it:
Code: Show/Hide
$(MODULE_OUTPUT_DIR)SS_Items.so: $(MODULE_DIR)SS_Items/Gun.h
Back to top
Bak
?ls -s
0 in


Age:20
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Mon Sep 25, 2006 2:04 pm    Post subject: Reply to topic Reply with quote

Hmm the touch thing seems like a good idea...

I'd do it that way Smong, except that in the more general case, let's say Modules.h depends on some files and every module uses modules.h, I'd end up having to add all those files to every module...
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 143 page(s) served in previous 5 minutes.

phpBB Created this page in 0.154854 seconds : 30 queries executed (29.2%): GZIP compression disabled