Reputation: 39678
I am building an application that will run on a Linux system. Currently, the build process consists of a simple Makefile that is already far too complex.
Now I guess I am missing some basic understanding about how to properly develop a Linux application. Information I found is:
make install
target that moves all files to the right place./usr/bin
or /usr/local/bin
./usr/share
or /usr/local/share
respectively. One should be able to configure the path prefix somewhere in the build process.Having this information, I am now wondering:
So I am basically looking for some good resources that give me an overview about the possibilities and common practice, and enable me to make an informed decision about whether and how to tweak the build and deployment process.
Upvotes: 0
Views: 1440
Reputation: 332
You normally have a ./configure script to run before making. This script is for checking dependancies. Setting compile time switches to project specific changes and so on. This is also the place to set the prefix, normally you should install to /usr/local if you give no prefix.
If you later on create packages (*.rpm, *.deb ...) for some distributions you normally use /usr/ as prefix there.
As it is insane to write a complete ./configure by hand, gnu autotools are used widely. They are a bit bloaty an some pain in the beginning, but do a really good job.
You could take a look at some tutorials like: http://markuskimius.wikidot.com/programming:tut:autotools/
I can tell nothing about cmake, as i have no experience with that.
Regarding your last question:
This is contract work, should I really care about these things? The application will only run on the customer's systems which are well-defined, so I could get away with supplying a folder that contains all necessary files, and the application could be executed from within that folder.
YES you should care about that. In case of updates and upgrading this will simplify your life.
Upvotes: 1