Godwars Mud Resource  
  Login or Register
|  Home  |  Downloads  |  Forums  |  YAccount  |
Main Menu   
 
HomeHome  
    Home
Members  
    Groups
    Members List
    Private Messages
    Profile
Community  
    Forums
    Mud Reviews
    Search
    Surveys
Statistics  
    Statistics
    Top 10
Files & Links  
    Downloads
    Web Links
News  
    News
    Topics
Other  
    Shout Box
    Who-is-Where
    FAQ
    Donations
    Site Map
    Stories Archive
    Recommend Us
    Feedback
Arcade  
 
Whats new in Files Section   
 
  Files: 38
  Categories: 10
  Downloads: 4542
  Served: 4.55 GB

Latest Downloads

 1: Paladin
[Hits: 1 x]

 2: Cotn 2.5.1
[Hits: 12 x]

 3: Children of the Night 4.3
[Hits: 73 x]

 4: Age of Heroes 1.4
[Hits: 27 x]

 5: Age of Hereoes 1.3
[Hits: 34 x]

Most Downloaded

 1: Children of the Night 4.2
[Hits: 484 x]

 2: Godwars 1996
[Hits: 399 x]

 3: Utopia: Type Final
[Hits: 328 x]

 4: Spell Writer
[Hits: 259 x]

 5: Zarius's Dystopia 1.4
[Hits: 253 x]
 
Hacker Beware   
 
 You have been warned!
We have caught 36 shameful hackers.

NukeSentinel(tm) 2.6.01
 

http://www.mudfiles.com :: View topic - Trouble with Makefile
 
 http://www.mudfiles.com Forum IndexForum Index   SearchSearch   UsergroupsUsergroups   ProfileEdit your profile   MembersMembers   Private MessagesLog in, check messages  
 RanksRanks   StaffStaff   StatisticsStatistics   Board RulesBoard Rules   Forum FAQForum FAQ   Login / LogoutLog in 

Search for at
http://www.mudfiles.com Advanced Search


 
Recent Topics   Next 6 >>  
 Forum   Author   Replies   Last Post 
COTN 4.0 General Mud Discussion Jackierus 3 Mon Sep 06, 2010 6:45 am
Jackierus View latest post
Cotn 4.0 Mud Ads Xrakisis 5 Fri Sep 03, 2010 9:06 am
Jackierus View latest post
The Realm of War Mud Ads Tijer 2 Sun Aug 29, 2010 7:02 pm
Tijer View latest post
Testing something General Mud Discussion Tijer 1 Wed Aug 18, 2010 3:50 pm
Tijer View latest post
GodWars GUI Godwars Coding KaVir 4 Wed Aug 18, 2010 5:10 am
Jindrak View latest post
Locke and his ridiculous demands over on Mudconnector Announcements and News Tijer 6 Mon Aug 16, 2010 8:41 pm
Tijer View latest post

Trouble with Makefile

Post new topicReply to topicprinter-friendly view http://www.mudfiles.com Forum Index -> Godwars Coding
View previous topic :: View next topic
Author Message
Septimus




Joined: Mar 01, 2007
Posts: 57
Location: New Zealand

Status: Offline
PostPosted: Fri Feb 05, 2010 1:31 am Post subject: Trouble with Makefile Reply with quote

Long time no see fellas.

So I've been bored and pulled out an old copy of Godwars and the whole having the .o files in the same directory as the .c files was pissing me off, so I tried to modify the Makefile to move the .o files into their own directory, and it's almost there, but not quite, I can't figure out what exactly is going wrong:

Code:

CC      = gcc
C_FLAGS = -w -ggdb3 -g -Wall
L_FLAGS = -lz -lcrypt -lpthread
O_DIR   = o

FILES   =       act_comm.c      act_info.c      act_move.c      act_obj.c       act_wiz.c       bit.c           \
                board.c         build.c         clan.c          comm.c          daemon.c        db.c            \
                angel.c         socials.c       demon.c         drow.c          fight.c         kav_wiz.c       \
                handler.c       kav_fight.c     kav_info.c      interp.c        mage.c          magic.c         \
                mem.c           monk.c          monk2.c         ninja.c         olc.c           upgrade.c       \
                olc_act.c       olc_save.c      save.c          special.c       string.c        arena.c         \
                update.c        vamp.c          ww.c            shapeshifter.c  tanarri.c       undead_knight.c \
                wraith.c        samurai.c       wizutil.c       const.c         spiderdroid.c   lich.c          \
                jope.c          titan.c         archer.c        jobo_king.c     jobo_data.c     jobo_fight.c    \
                jobo_act.c      jobo_wiz.c      jobo_util.c     darrens.c       changes.c       mudinfo.c       \
                marcus.c        challenge.c     auction.c       mccp.c

O_FILES := $(patsubst %.c,$(O_DIR)/%.o,$(FILES))

merc: $(O_FILES)
        rm -f gwo
        $(CC)  -o gwo $(O_FILES) $(L_FLAGS)
        chmod g+w gwo
        chmod g+w $(O_FILES)

$(O_DIR)/%.o: %.c
        $(CC) -c $(C_FLAGS) $<

.c.o: merc.h
        $(CC) -c $(C_FLAGS) $<

clean :
        rm -f $(O_DIR)/*.o ; rm -f gwo



This is The Gospel according to St. Bastard.

============================

GodWars Oxide

mcp-server.com 4444
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Jindrak




Joined: Oct 19, 2006
Posts: 273
Location: Cooperstown NY

Status: Offline
PostPosted: Fri Feb 05, 2010 2:28 pm Post subject: Re: Trouble with Makefile Reply with quote

The problem I remember having a few years ago when I moved my object files to a different directory was:

$(O_DIR)/%.o: %.c

I pointed directly to the object directory

In my case: ../o/%.o: %.cc


As a site note you can use a wild card for your c files also instead of that ugly mess you have right now...

C_FILES := $(wildcard *.c)


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Septimus




Joined: Mar 01, 2007
Posts: 57
Location: New Zealand

Status: Offline
PostPosted: Fri Feb 05, 2010 11:11 pm Post subject: Re: Trouble with Makefile Reply with quote

Still can't figure out where it's not working though. The object files are being created, just not dropped in the object directory.


This is The Gospel according to St. Bastard.

============================

GodWars Oxide

mcp-server.com 4444
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Jindrak




Joined: Oct 19, 2006
Posts: 273
Location: Cooperstown NY

Status: Offline
PostPosted: Sat Feb 06, 2010 9:59 pm Post subject: Re: Trouble with Makefile Reply with quote

http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/

Try that web site...I see towards the bottom they have some examples for what you're trying to do.  I had found some decent Makefile tutorial sites a month or so ago when I was trying to get some information on file dependencies.  Couldn't get find to much info on what I needed done in it and gave up after time.  I had bookmarked some of the sites but I deleted them and I can't seem to find the sites I found even with the same searches on Google...


Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Septimus




Joined: Mar 01, 2007
Posts: 57
Location: New Zealand

Status: Offline
PostPosted: Sun Feb 07, 2010 3:30 pm Post subject: Re: Trouble with Makefile Reply with quote

Lol, I really am lost now, trying to do it like he does it in that tutorial but I can't get there, it's a shame, the tutorial was really good up until the last bit, well worded, well explained, easy to understand, but then he throws that last bit in there without explaining what he's actually done, and so far trying to get the same thing working on mine is just plain not working >.<


This is The Gospel according to St. Bastard.

============================

GodWars Oxide

mcp-server.com 4444
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Septimus




Joined: Mar 01, 2007
Posts: 57
Location: New Zealand

Status: Offline
PostPosted: Sun Feb 07, 2010 4:02 pm Post subject: Re: Trouble with Makefile Reply with quote

Woo, just got it working finally.

Code:

CC      = gcc
C_FLAGS = -w -ggdb3 -g -Wall
L_FLAGS = -lz -lcrypt -lpthread
O_DIR   = o/

FILES   =       act_comm.c      act_info.c      act_move.c      act_obj.c       act_wiz.c       bit.c           \
                board.c         build.c         clan.c          comm.c          daemon.c        db.c            \
                angel.c         socials.c       demon.c         drow.c          fight.c         kav_wiz.c       \
                handler.c       kav_fight.c     kav_info.c      interp.c        mage.c          magic.c         \
                mem.c           monk.c          monk2.c         ninja.c         olc.c           upgrade.c       \
                olc_act.c       olc_save.c      save.c          special.c       string.c        arena.c         \
                update.c        vamp.c          ww.c            shapeshifter.c  tanarri.c       undead_knight.c \
                wraith.c        samurai.c       wizutil.c       const.c         spiderdroid.c   lich.c          \
                jope.c          titan.c         archer.c        jobo_king.c     jobo_data.c     jobo_fight.c    \
                jobo_act.c      jobo_wiz.c      jobo_util.c     darrens.c       changes.c       mudinfo.c       \
                marcus.c        challenge.c     auction.c       mccp.c

O_FILES = $(patsubst %.c,$(O_DIR)%.o, $(FILES))

merc: $(O_FILES)
        rm -f gwo
        $(CC)  -o gwo $(O_FILES) $(L_FLAGS)
        chmod g+w gwo
        chmod g+w $(O_FILES)

$(O_DIR)%.o: %.c
        $(CC) -c $(C_FLAGS) $< -o $@

clean:
        rm -f $(O_FILES) ; rm -f gwo

.c.o: merc.h
        $(CC) -c $(C_FLAGS) $<


Cheers for the help Jindrak, appreciate it.

P.S. the file array isn't really that messy, it's all nice and tabbed out, tabs just don't seem to translate well to the forum.


This is The Gospel according to St. Bastard.

============================

GodWars Oxide

mcp-server.com 4444
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Display posts from previous:
Post new topicReply to topic printer-friendly view http://www.mudfiles.com Forum Index -> Godwars Coding Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1


Jump to:  
You cannot post new topics in this forum
You cannot 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 cannot attach files in this forum
You cannot download files in this forum




Powered By: phpBB © 2001 - 2006 phpBB Group
subBlack Theme Conversion By: Shellz | Upgraded to v1.01 By: The Mortal

Ported to the phpBB Nuke module by coldblooded
Forums ©
User Info   
 
Good evening 
Anonymous



Register
Lost Password
Username
Password

 Online:   
Member(s):

Guest(s):
01. Guest
02. Guest
03. Guest
04. Guest
05. Guest
06. Guest
07. Guest

Most Ever Online:   
 Guest(s): 59
 Member(s): 0
 Total: 59

Forums Forums:   
 Posts: 2,228
 Topics: 401
 
Donations   
 

Find our site useful? Make a small donation to show your support.

 
Survey   
 

No Surveys!

 
New Downloads   
 
 
Who-is-Where   
 
 
Shout Box   
 
Shout History   
 
 
PHP Hosting

Spambot Killer
Site Map

[News Feed] [Forums Feed] [Downloads Feed] [Web Links Feed] [Validate robots.txt]

Copyright 2006 Godwars.net

PHP-Nuke Copyright © 2006 by Francisco Burzi.
All logos, trademarks and posts in this site are property of their respective owners, all the rest © 2006 by the site owner.
Powered by Nuke-Evolution.

This site is cached. Click here to update the cache.
[ Page Generation: 0.22 Seconds | Memory Usage: 12.59 MB | DB Queries: 134 ]

Do Not Click

:: subBlack phpbb2 style by spectre :: PHP-Nuke theme By: www.nukemods.com ::