I am writing a Bash script that automatically updates a repository containing source code and then compiles it. I have been a bit stuck on the part about how to start the compilation itself, i.e. if I should cat all the files in the repository and look for the main (or equivalent) function and then compile that file. Or if I should let the user specify which file in the repository contains the main function (or possibly a makefile) in the config file. This option requires more work and insight from the user, but I fear that the first option might cause long delays by unnecessary scanning all the files in the repository. What would be the best approach for solving this problem?

  • 2
    This depends a lot on what kind of files are in the repository. For a C projects ./configure && make && make install is a form of a de-facto standard. For Python python setup.py install is the same. The platform you are using also contributes. Windows users would tend to use a visual studio project rather than the command line to compile native code.
    – Will
    Apr 24, 2013 at 16:17
  • 1
    I presume you mean "checks out a repository and then compiles it"? Apr 24, 2013 at 18:03
  • Checks out (if it does not already exist) or updates it with the newest revision if it does. Apr 25, 2013 at 12:03


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.