How To Compile Everything
- Is there a README?
- Read it.
Dynamic languages
- Is it mostly PHP?
- Does it need PHP libraries?
- It probably needs a web server
- Does it need a database?
- Is it mostly Python?
- Is there a
setup.py
?virtualenv . ; bin/python setup.py develop
, I think.
- Is there a
requirements.txt
?- Install the things there, maybe with pip or something??
- Does it need a web server? (Does it need a web server, or does a builtin one suffice?)
- Does it need a database? (Does it need a database, or does SQLite suffice?)
- Is there a
- Is it mostly Ruby?
- Ask someone not me.
- Someone not me says:
- Does it have a Gemfile, or a .gemspec? Run bundle.
- Is it Rails? Run rake. (Did you bundle install?) Now do ./script/server (Rails 2.x) or rails server (Rails >=3). Consider making someone else host it - Heroku?
- Is it not Rails? Does it have a Rakefile? Run rake.
- No Rakefile? Are you sure this is ruby?
- Is it mostly Perl?
- Is there a
Makefile.PL
at the top level, and noMakefile
?- Run
perl Makefile.PL
, then follow theMakefile
instructions. - If you want to set a prefix, run
perl Makefile.PL PREFIX=/home/geofft
. You don't need to pass the prefix to any other commands.
- Run
- Is there a
C
- Is there a
Makefile
orGNUmakefile
?- Usually you can just run
make
to compile it. - Often you can also run
sudo make install
to install it systemwide. Sometimes this won't exist, and all you get is compiled code in the same directory. - If you want to install it, but not systemwide, generally you can use a prefix variable to make it install elsewhere; for instance I might want to set the prefix to
/home/geofft
so things are in/home/geofft/bin
, etc. If there was just aMakefile
and nothing special, try runningmake PREFIX=/home/geofft
andmake install PREFIX=/home/geofft
, without sudo. Or read theMakefile
or README.
- Usually you can just run
- Is there a
configure
?- Usually you can just run
./configure
, followed bymake
andsudo make install
, as per theMakefile
decision branch. - To set a prefix, run
./configure --prefix=/home/geofft
. - Running configure will error out if it requires something you don't have installed. But check its output, as it might be skipping something optional but useful, that you should have installed.
- Usually you can just run
- Is there a
autogen.sh
, but noconfigure
(with no extension)? Sometimesautogen.sh
is calledbootstrap
or something.- Make sure you have autoconf and automake installed.
- Run
./autogen.sh
, then start from theconfigure
decision branch. - Rarely,
autogen.sh
will also runconfigure
for you; if you want to pass options, you can either rerun./configure
yourself, or pass them to./autogen.sh
.
- Is there a
configure.ac
orconfigure.in
, but noautogen.sh
? (If there is one, prefer that)- Make sure you have autoconf and automake installed.
- Run
autoreconf -fvi
, then start from theconfigure
decision branch.
Java
- Is there a
build.xml
?- Are there files with Android-y names?
- Install the Android utilities, then run
android update project --path .
so that your paths to the Android SDK are set. You'll probably need to specify the full path to theandroid
command, like~/Downloads/adt-bundle-something/sdk/tools/android update project --path .
. - If it tells you to use
- Run
ant debug
, to make a debug build. (See the output ofant
to see the list of options.) - You can try using
ant install
to run it on the currently-running simulator, or the currently-plugged in device. You might have more luck with theadb
command directly, though.
- Install the Android utilities, then run
- Run
ant
, which should either work or give you a list of options.ant build
might be the option that you want.
- Are there files with Android-y names?
- Is there a
pom.xml
?- Curse at Maven a bit, then run
mvn compile
and hope for the best - Consider using Eclipse
- Curse at Maven a bit, then run
- Sometimes Java programs are servlets, which you can tell by, like,
WEB-INF
directories orweb.xml
files running around- You'll want a "servlet container" like Tomcat or Jetty, which is a fancy word for a web server that runs Java servlets
- Jetty can run standalone, with no advance setup, and there's often a Maven target for that
Other things
- Is there a
debian
directory? Are you building something Debian-specific?
- Make sure everything in the
Build-Depends
line of debian/control
is installed. If the package is in the Debian/Ubuntu archive, the easiest way to do this is sudo apt-get build-dep package
. This works even if you're building a package from a slightly different source than the one in the archive; it'll get you at least 90% of the way there.
- Run
debuild
, which is in the devscripts
package.