The simplest way to share your program is compile it and share the binaries. There are a lot of open question you will have to solve (libraries dependencies, specific distribution configurations, …). You must to precompile for every targeted hardware architecture (x86-64, ARM, …) and for every specific SO (BSD, Linux, … even Windows).
As an example, Gimp is coded in C/C++ and exists binaries for many hardware architectures and operating systems.
2
solved Install a C program to another machine without share code [closed]