Is there a package format for compacting source code files that provides end users with a straightforward and straightforward option to compile (and install) the program?

For example, in addition to the action "Open", "Compile and Install" is another action available when the user clicks on the package.