I posted a detailed answer using Scons on tex.stackexchange.
Basically, you put this in a file called SConstruct:
# make sure scons finds tex executables:
import os
env = Environment(ENV=os.environ)
# target and source:
pdf_output = env.PDF(target='main.pdf', source='main.tex')
# make sure that the pdf is reloaded properly (e.g., in Skim)
env.Precious(pdf_output)
You can build the pdf simply by running
scons
Amazingly, scons will detect the changes in the files \included in the main.tex file and also the bibliography file!