Game Development Community

Add new *.cc files to the makefile

by Robert Norris · in Torque Game Engine · 08/30/2005 (12:07 am) · 3 replies

Hi,

i have no experience in working with makefiles, because i'm a windows and VC++ user (sorry for that ;) )... but i have a linux server and want to compile and run a dedicated server build of the SDK. This worked fine until i tried to add my own files.

I've edited the targets.torque.mk file in this way:

...

[b]SOURCE.PROJECT.ROLLER=\
	project/roller/droid.cc[/b]
	
SOURCE.ENGINE =\
	$(SOURCE.COLLISION) \
	$(SOURCE.CONSOLE) \
	$(SOURCE.CORE) \
	$(SOURCE.DGL) \
	$(SOURCE.INTERIOR) \
	$(SOURCE.MATH) \
	$(SOURCE.PLATFORM) \
	$(SOURCE.SCENEGRAPH) \
	$(SOURCE.SIM) \
	$(SOURCE.TERRAIN) \
	$(SOURCE.TS) \
	$(SOURCE.AUDIO) \
	$(SOURCE.GUI) \
	$(SOURCE.GAME) \
	$(SOURCE.GAME.FPS) \
	$(SOURCE.GAME.NET) \
	$(SOURCE.GAME.FX) \
	$(SOURCE.GAME.VEHICLES) \
	[b]$(SOURCE.PROJECT.ROLLER)[/b]

...

SOURCE.TESTAPP =\
	$(SOURCE.AUDIO) \
	$(SOURCE.COLLISION) \
	$(SOURCE.CONSOLE) \
	$(SOURCE.CORE) \
	$(SOURCE.DGL) \
	$(SOURCE.EDITOR) \
	$(SOURCE.GUI) \
	$(SOURCE.GAME) \
	$(SOURCE.GAME.FPS) \
	$(SOURCE.GAME.NET) \
	$(SOURCE.GAME.FX) \
	$(SOURCE.GAME.VEHICLES) \
	$(SOURCE.INTERIOR) \
	$(SOURCE.MATH) \
	$(SOURCE.PLATFORM) \
	$(SOURCE.SCENEGRAPH) \
	$(SOURCE.SIM) \
	$(SOURCE.TERRAIN) \
	$(SOURCE.TS) \
	[b]$(SOURCE.PROJECT.ROLLER)[/b]

...

But i get this error, after i do a make clean, make dedicated call (my error message is in german, but i translated it as good as i can :) ):

mkdir: cannot create directory

#1
08/30/2005 (1:54 am)
You will have to edit the conf.UNIX.mk makefile and add the -p option to the mkdir command specification, since you have multiple subdirectories and I'm sure you don't have any source files on project/ so that dir is never created. The -p option tells mkdir to create all the dirs that don't exist to form the full path.
#2
08/30/2005 (2:36 am)
Thank you so much! You saved my day :)

best regards
rob
#3
08/30/2005 (5:02 am)
Yup, X marks the spot ;)

Sending this in a patch along with several other platformX86UNIX fixes to BenG

-Ron