In regards to your question "When I use the make command is the binary made in the same directory as the source files?" that all depends on what the Makefile tells it to do. But, as general rule, in my experience anyway, the directory that the main source file resides in is usually the one that you'll find the final binary in. What program are you wondering about in particularly? As most programs have more than just the executable binary, they would usually have libraries, config files, pixmaps, man pages, etc.
As for being able to simply copy just the binary to a completely different distro, this might work for extremely basic programs, but if it relies on being able to access libraries, or images or what have you, which almost all programs are, then there is no chance. The reason for this is that all distro's are fundamentally the same, as in they all use the same libraries & can all run the same apps, but the location in the filesystem that each one stores the different parts of the system can change enormously from distro to distro. For example, if you compile something under Fedora, & say it uses a library that already exists, which most programs do, during the configure stage, configure will find the library & hard code it's location into the binary, in Fedora this would usually be /usr/lib. Now, if you move that binary to a different distro, say SuSE, the library that your binary is dependent on to function correctly will usually be installed, but it will be in a different location. (I think SuSE likes to put things under /opt/lib) So when you try & run it, it will seg fault because it won't be able to locate the resources that it needs. This is called "breaking dependencies". This is where RPM's & DEB's & so on come into the picture. They are pre-compiled to run under ONE particular distro. RPM's are the best thing since sliced bread! They make installing progs extra easy!
So to answer your question, no, you most probably won't be able to just copy over the source that you compiled on a different distro & expect it to work. You will have to copy over the source tarball & recompile it from scratch.
Most programs are written in such a way that when they compile, they keep everything they are doing within their top level directory. There are some exceptions, but usually this is the case. What program are you wondering about?
Geez, this is becoming a long post.
As for the last line of my last post, at your terminal type:
echo $PATH
You should get something like:
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/sbin:/sbin:/root/bin
This is called, surprise, surprise, your path! It is simply a list of dirs that the system searches in whenever you execute something. For example, to run cp, instead of typing out the entire path - /bin/cp - every time you want to copy something, you only need type cp & the system takes care of the rest because /bin is in your path. This is why files of the same type, especially executables, are all stored in the same place. Now, when I say "remember to add /usr/local/bin to your $PATH", this means that you need to edit the file that creates this path for you & add /usr/local/bin to the $PATH variable. Because if you don't, every time that you want to run whatever it is that you are putting in there, you would have to type out the entire path instead of just the name of the program itself.
This is done is by editing .bash_profile in your home dir if you only want the changes to only affect your user, or you can edit /etc/profile if you want the changes to affect every user on your system.
In ~/.bash_profile, find the following lines, somewhere near the bottom:
############################################################################
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
############################################################################
then change
PATH=$PATH:$HOME/bin
to
PATH=$PATH:$HOME/bin:/usr/local/bin
As for /etc/profile, somewhere near the bottom,
############################################################################
if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
INPUTRC=/etc/inputrc
fi
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
############################################################################
add the following just before the line that starts "export PATH USER..."
PATH=$PATH:/usr/local/bin
Now your $PATH variable knows that you want to be able to access /usr/local/bin from anywhere in the filesystem. You can add as many as you like, each one just has to be separated by a ":" (eg: $PATH:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin)
The other thing was, "add /usr/local/lib to /etc/ld.so.conf & run /sbin/ldconfig as root"
To cut a long story short, /etc/ld.so.conf is a list of where to find library files, then running "/sbin/ldconfig as root" sorts through & updates how all the linked libraries link together. Basically, if you start installing programs to other places in the filesystem, whichever dir that the libraries end up in, must be added to /etc/ld.so.conf so that /sbin/ldconfig knows where to find all the new linked libraries, & be able to link them to the files that were used to create them when they got compiled. See man ldconfig for more.
I don't know how much of that you already knew, but, you asked for it!
There's a hell of a lot more to it than that too. The Linux filesystem for each distro works in a different way, but the underlying "rules" mean that to take advantage of all it's power you need to learn how it works. This is a grouse site, I've read it start to finish a few times & check it for reference all the time. Check it out, -->
http://www.tldp.org/LDP/intro-linux/html/index.html if you don't learn something from here, your just not tiring!
This is an excellent doc for all things Linux. Read it start to finish & you'll be