Game Development Community

Renaming output executive!

by Matthew Shapiro · in Torque Game Engine · 09/22/2002 (11:12 am) · 9 replies

I want to have a different executable based on what os I would compiling it for. First of all i want it to save with the name of my project. 2nd of all i want to have say the makefile put a _UNIX on the end of it if it's for linux. same wiht OSX

how would i go about doing this?

--KallDrexx

#1
09/22/2002 (11:42 am)
(For linux)
Look in engine/targets.torque.mk :

Quote:
#----------------------------------------
# normal binary
-->$(EXE_NAME): $(DIR.OBJ)/$(EXE_NAME)$(EXT.EXE)

DIR.LIST = $(addprefix $(DIR.OBJ)/, $(sort $(dir $(SOURCE.TESTAPP_CLIENT))))

$(DIR.LIST): targets.torque.mk

-->$(DIR.OBJ)/$(EXE_NAME)$(EXT.EXE): CFLAGS += $(INCLUDES_$(OS))

-->$(DIR.OBJ)/$(EXE_NAME)$(EXT.EXE): LIB.PATH +=../lib/$(DIR.OBJ) \

-->$(DIR.OBJ)/$(EXE_NAME)$(EXT.EXE): LINK.LIBS.GENERAL += \
$(PRE.LIBRARY.LIB)ljpeg$(EXT.LIB) \
$(PRE.LIBRARY.LIB)lpng$(EXT.LIB) \
$(PRE.LIBRARY.LIB)lungif$(EXT.LIB) \
$(PRE.LIBRARY.LIB)zlib$(EXT.LIB)

-->$(DIR.OBJ)/$(EXE_NAME)$(EXT.EXE): $(DIR.OBJ) $(DIR.LIST) $(SOURCE.TESTAPP_CLIENT.OBJ)
$(DO.LINK.CONSOLE.EXE)
--> $(CP) $(DIR.OBJ)/$(EXE_NAME)$(BUILD_SUFFIX).* ../example

Change the lines marked with "-->" and add something like something like :

$(DIR.OBJ)/$(EXE_NAME)_linux$(EXT.EXE)
#2
09/22/2002 (11:45 am)
If you're using makefiles, then you can edit the line at the top of engine/targets.torque.mk. The makefiles define a OS variable (WIN32, LINUX, etc), that you could use there, something like this:

EXE_NAME=torqueDemo_$(OS)
EXE_DEDICATED_NAME=torqueDemod_$(OS)
#3
09/22/2002 (11:56 am)
Lol... I didn't notice that at the top =)

*shoots himself*
#4
09/22/2002 (12:27 pm)
ah ok one final question. wehre in the makefile do I change the directory it puts the binary in?

--KallDrexx
#5
09/22/2002 (12:33 pm)
The gcc drops the executable in out.GCC2.DEBUG or wherever, but targets.torque.mk also has a command to copy it to the example directory. Look for "../example" in the file.
#6
09/22/2002 (12:35 pm)
also any way to test it out with gcc3.2?

--KallDrexx
#7
09/22/2002 (1:05 pm)
You mean compile with gcc3? The only difference with gcc3 in the makefiles is that the command "gcc3" is used instead of "gcc". If this is the case on your system, then just reconfigure the build with

make -f mk/configure.mk OS=LINUX COMPILER=GCC3 BUILD=DEBUG

and then do "make".
#8
09/22/2002 (1:19 pm)
Hmm I have gcc 3.2, which is gcc-3.2, not gcc3 (executable file i mean) so therefore setting it to GCC3 makes it so i can't compile.. any ideas?

--KallDrexx
#9
09/22/2002 (1:35 pm)
Just change the name of the gcc program in conf.GCC3.LINUX.mk