When using 'make', where does the compled executable go?

Asked by LEGOManiac

I've been experimenting with some software that is newer than the releases available via package manager and attempting to compile them myself.

For the most part, things go well. However, while most source packages include a detailed ReadMe that list the dependencies, not all of them tell you where the file will end up when it's compiled.

I've also noticed this with some things I've downloaded via Synaptic Package Manager. You install the package but it isn't in any of the Applications menus.

I'm guessing that, if the executable doesn't end up in the same directory as the makefile, that it must be put in some commonly known location (like /usr/bin) but I don't know what it is.

Is there a way to tell where the executable ended up? The makefile itself doesn't list a path that I can see.

My latest attempt is with OpenGF-RC1-1.0-linux

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
LEGOManiac
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Bernhard (b.a.koenig) said :
#1

There are different directories where it might end up, eg

/bin
/usr/bin
/usr/local/bin

if it's in any of these, it should be in your PATH variable and you should be able to execute it from everywhere.

Revision history for this message
Bernhard (b.a.koenig) said :
#2

Try this to find it btw,

sudo updatedb
locate OpenGF

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#3

I had tried using locate OpenGF before I wrote in and it only finds the entries in the download directory I created. That's why I was wondering if it might have compiled it under another name which, in turn, is why I thought the makefile might have given me a clue as to what it would now be called.

I've tried running make again and it says "nothing to be done for src/animation.d

I presume from this that the file is already compiled successfully.

On the off-chance that locate either didn't work properly or that I just missed it in the output, I did a manual search of /bin, /usr/bin and /usr/local/bin for a file called OpenGF but it isn't there.

Any other ideas?

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#4

Oops. I clicked the wrong button.

Revision history for this message
Tomasz 'Zen' Napierala (tzn) said :
#5

Binary file should be in "bin" directory of unpacked source.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#6

Going to the unpacked OpenGF-RC1-1.0-linux directory and typing ls -l -R * and checking for execute permissions, I see that NONE of the files, by any name, have the execute permission set, with the exception of the sub-directories.

When I'm in the Release sub-directory (where the makefile is), typing 'make' doesn't produce any errors (other than to say "nothing to be done for animation.d" which is located in the src directory.

Again, I'm at a total loss here. I presume something was done by 'make' but I don't know how to find it, nor even what it would be called.

Revision history for this message
Tomasz 'Zen' Napierala (tzn) said :
#7

I just did a test compilation, and after that I can see OpenGF file in bin subfolder
Can you please remove folder with sources, unpack it again, run make and paste the output?

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#8

I had deleted the original archive so I downloaded it again. Well, the first thing I notice is that the available file is no longer RC1 but RC2. Also, the "Project" folder has been replaced by a "bin" folder with what appears to be the same contents.

libsdl-mixer1.2.dev is now listed as a prerequisite, so I've just installed it.

The results of 'make'

Building file: ../src/animation.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/animation.d" -MT"src/animation.d" -o"src/animation.o" "../src/animation.cpp"
Finished building: ../src/animation.cpp

Building file: ../src/background_saver.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/background_saver.d" -MT"src/background_saver.d" -o"src/background_saver.o" "../src/background_saver.cpp"
Finished building: ../src/background_saver.cpp

Building file: ../src/bumper.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/bumper.d" -MT"src/bumper.d" -o"src/bumper.o" "../src/bumper.cpp"
In file included from ../src/bumper.h:32,
                 from ../src/bumper.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/bumper.cpp

Building file: ../src/engine.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/engine.d" -MT"src/engine.d" -o"src/engine.o" "../src/engine.cpp"
Finished building: ../src/engine.cpp

Building file: ../src/fatal_exception.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/fatal_exception.d" -MT"src/fatal_exception.d" -o"src/fatal_exception.o" "../src/fatal_exception.cpp"
Finished building: ../src/fatal_exception.cpp

Building file: ../src/font_manager.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/font_manager.d" -MT"src/font_manager.d" -o"src/font_manager.o" "../src/font_manager.cpp"
Finished building: ../src/font_manager.cpp

Building file: ../src/game_engine.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/game_engine.d" -MT"src/game_engine.d" -o"src/game_engine.o" "../src/game_engine.cpp"
In file included from ../src/game_logic.h:33,
                 from ../src/render_engine.h:36,
                 from ../src/game_engine.h:34,
                 from ../src/game_engine.cpp:30:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/game_engine.cpp

Building file: ../src/game_logic.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/game_logic.d" -MT"src/game_logic.d" -o"src/game_logic.o" "../src/game_logic.cpp"
In file included from ../src/game_logic.h:33,
                 from ../src/game_logic.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/game_logic.cpp

Building file: ../src/good_choice_animation.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/good_choice_animation.d" -MT"src/good_choice_animation.d" -o"src/good_choice_animation.o" "../src/good_choice_animation.cpp"
In file included from ../src/good_choice_animation.h:36,
                 from ../src/good_choice_animation.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/good_choice_animation.cpp

Building file: ../src/image_file_manager.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/image_file_manager.d" -MT"src/image_file_manager.d" -o"src/image_file_manager.o" "../src/image_file_manager.cpp"
Finished building: ../src/image_file_manager.cpp

Building file: ../src/image_text_manager.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/image_text_manager.d" -MT"src/image_text_manager.d" -o"src/image_text_manager.o" "../src/image_text_manager.cpp"
Finished building: ../src/image_text_manager.cpp

Building file: ../src/joker_up_animation.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/joker_up_animation.d" -MT"src/joker_up_animation.d" -o"src/joker_up_animation.o" "../src/joker_up_animation.cpp"
Finished building: ../src/joker_up_animation.cpp

Building file: ../src/level_up_animation.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/level_up_animation.d" -MT"src/level_up_animation.d" -o"src/level_up_animation.o" "../src/level_up_animation.cpp"
Finished building: ../src/level_up_animation.cpp

Building file: ../src/note_generator.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/note_generator.d" -MT"src/note_generator.d" -o"src/note_generator.o" "../src/note_generator.cpp"
In file included from ../src/note_generator.h:38,
                 from ../src/note_generator.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/note_generator.cpp

Building file: ../src/note_out_animation.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/note_out_animation.d" -MT"src/note_out_animation.d" -o"src/note_out_animation.o" "../src/note_out_animation.cpp"
In file included from ../src/note_out_animation.h:33,
                 from ../src/note_out_animation.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/note_out_animation.cpp

Building file: ../src/opengf.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/opengf.d" -MT"src/opengf.d" -o"src/opengf.o" "../src/opengf.cpp"
In file included from ../src/game_logic.h:33,
                 from ../src/render_engine.h:36,
                 from ../src/game_engine.h:34,
                 from ../src/opengf.cpp:30:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/opengf.cpp

Building file: ../src/render_engine.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/render_engine.d" -MT"src/render_engine.d" -o"src/render_engine.o" "../src/render_engine.cpp"
In file included from ../src/game_logic.h:33,
                 from ../src/render_engine.h:36,
                 from ../src/render_engine.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/render_engine.cpp

Building file: ../src/sound_engine.cpp
Invoking: GCC C++ Compiler
g++ -O3 -pedantic -Wall -c -fmessage-length=0 -MMD -MP -MF"src/sound_engine.d" -MT"src/sound_engine.d" -o"src/sound_engine.o" "../src/sound_engine.cpp"
In file included from ../src/game_logic.h:33,
                 from ../src/sound_engine.h:37,
                 from ../src/sound_engine.cpp:27:
../src/notes.h:151: warning: ‘typedef’ was ignored in this declaration
Finished building: ../src/sound_engine.cpp

Building target: OpenGF
Invoking: GCC C++ Linker
g++ -o"OpenGF" ./src/animation.o ./src/background_saver.o ./src/bumper.o ./src/engine.o ./src/fatal_exception.o ./src/font_manager.o ./src/game_engine.o ./src/game_logic.o ./src/good_choice_animation.o ./src/image_file_manager.o ./src/image_text_manager.o ./src/joker_up_animation.o ./src/level_up_animation.o ./src/note_generator.o ./src/note_out_animation.o ./src/opengf.o ./src/render_engine.o ./src/sound_engine.o -lSDL -lSDL_image -lSDL_ttf -lSDL_mixer
Finished building target: OpenGF

I don't see anything wrong here and there is now an "OpenGF" file in the bin directory and it set as executable.

This doesn't work:
:~/Desktop/Downloads/OpenGF-RC2-1.2-Project/bin$ OpenGF
bash: OpenGF: command not found

But this does (sort of):
:~/Desktop/Downloads/OpenGF-RC2-1.2-Project/bin$ ./OpenGF
terminate called after2 throwing an instance of 'CFatalException'
Aborted

sudo ./OpenGF yeilds the same thing.

I'm guessing that if you don't include "./" it looks for the executable in the current execution path(s) vs. the current data directory.

I'm not sure what happened to RC1's executable but at least I can find the RC2 executable.

If you can offer any suggestiions as to what needs to be done from here, that would be great, but I realize it's getting outside of the scope of this forum. I'll check the project's forum on Sourceforge for suggestions.

Thanks for the help.