Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
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 '13 at 16:17
I presume you mean "checks out a repository and then compiles it"? –  Kilian Foth Apr 24 '13 at 18:03
Checks out (if it does not already exist) or updates it with the newest revision if it does. –  user1049697 Apr 25 '13 at 12:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.