LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-27-2008, 01:02 PM   #1
Four
Member
 
Registered: Aug 2005
Posts: 298

Rep: Reputation: 30
make nothing todo with subdirectories


Hello,

I have the following makefile

Code:
# unrelevant definitions like CC, LDFLAGS etc.. removed

PRECALC=perl precalc.pl

OBJS=main.o joystick.o player.o level.o conf.o gobject.o objectfactory.o \
	ginfo.o hplayer.o

all: $(RACE)
.SUFFIXES: .c .cpp .o

.c.o: %.c
	$(CC) $< -E $(CFLAGS) | $(PRECALC) | $(CC) -x c  -c - -o $@
	
.cpp.o: %.c
	$(CXX) $< -E $(CXXFLAGS) | $(PRECALC) | $(CXX) -x c++  -c - -o $@
	
$(RACE): $(OBJS)
	$(CXX) -o $(RACE) $^ $(LIBS) $(LIBSDIR) $(LDFLAGS);

clean:
	rm -f *.o
	rm -f $(RACE)


# Autogenerated list using gcc -E -MM


joystick.o: joystick.c joystick.h conf.h debug.h
conf.o: conf.c conf.h debug.h
objectfactory.o: objectfactory.cpp objectfactory.h debug.h \
	objects/gobject.h conf.h debug.h objects/player.h ginfo.h \
	objects/gobject.h conf.h objects/hplayer.h objects/player.h \
	objects/gobject.h joystick.h
level.o: level.cpp level.h conf.h objects/gobject.h conf.h debug.h \
	ginfo.h debug.h objectfactory.h objects/player.h ginfo.h \
	objects/gobject.h
ginfo.o: ginfo.cpp ginfo.h objects/gobject.h conf.h debug.h
main.o: main.cpp joystick.h conf.h objects/player.h debug.h conf.h \
	ginfo.h objects/gobject.h objects/gobject.h level.h ginfo.h debug.h
gobject.o: objects/gobject.cpp objects/gobject.h conf.h debug.h
player.o: objects/player.cpp objects/player.h debug.h conf.h ginfo.h \
	objects/gobject.h objects/gobject.h level.h conf.h ginfo.h
hplayer.o: objects/hplayer.cpp objects/hplayer.h objects/player.h debug.h \
	conf.h ginfo.h objects/gobject.h objects/gobject.h objects/gobject.h \
	joystick.h conf.h
	echo "Hello world"
Doing a "make hplayer.o" makes make printout "hello world", however doing a "make player.o" make prints out "make: Nothing to be done for `player.o'." similarly for any other file that depends on things in a subdirectory.

Why won't the objects that depend on subdirectories compile?
Thanks
 
Old 08-27-2008, 03:22 PM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by Four View Post
Doing a "make hplayer.o" makes make printout "hello world", however doing a "make player.o" make prints out "make: Nothing to be done for `player.o'." similarly for any other file that depends on things in a subdirectory.
Does player.o already exist?
 
Old 08-27-2008, 04:13 PM   #3
Four
Member
 
Registered: Aug 2005
Posts: 298

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by David1357 View Post
Does player.o already exist?
player.o does not exist.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make cp ignore subdirectories? M4l3k Linux - Newbie 4 02-28-2011 12:48 PM
Looking for Todo list in Linux and Windows bartonski Linux - Software 2 03-25-2007 11:37 PM
LXer: Task management made simple with todo.txt and Tux ToDo LXer Syndicated Linux News 0 10-05-2006 10:21 PM
PalmOS ageanda/todo guideweb Other *NIX 0 09-10-2005 12:10 AM
mysql install (though todo with hostname) sk8o *BSD 1 08-29-2003 09:36 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration