Linux/UNIX install data files Linux/UNIX install data files unix unix

Linux/UNIX install data files


There are some filesystem standards, reading up on FHS or something like that (note that there are different approaches to filesystem layout).

Basically, you put your executable binaries into $prefix/bin/, per-host configuration goes into $prefix/etc/, per-user into user's home directory, arch-independent static data into $prefix/share, arch-dependent data and libraries into $prefix/lib and the mutable data normally goes into /var/lib/.

It's better to have this stuff configurable both at compile-time and runtime. And it's also customary not to write Makefiles with install targets by hand, you may want to look at the autotools suite or similar (a matter of taste).


You should look at the File System Hierarchy standard.

In brief, if you program needs system-wide files, then config should go in /etc. Resources, such as scripts and image files go in /usr/share. Runtime data goes in /var/run.

Per-user files live in the user's home directory, of course.