Revision [32128]
This is an old revision of compiling made by PageStep007 on 2018-09-22 15:27:39.
Compiling
What is compiling?
It is the process of getting a program organized to work on a particular system.Overview
There are many operating systems in use today in computing. Many programs are written for a particular system and are system specific. However more and more, programs are being written for various operating systems at the same time. These are cross-platform programs. It is therefore necessary to back up a little and first write the program with no system in mind, then have a system whereby the program will install on any of the systems. The 'no-system-in-mind' code, is 'Source Code'.The programmer writes in a text editor, in a code language of choice, and to be more efficient, often use code other people have written. These are often called libraries. In Linux they have a .so extension and in windows they have .dll extension. The programmer may assume you already have the libraries on your system. This is particularly true if they are writing for a specific system, but they may use open source libraries. The source code package therefore gets to look like a huge jumble of files, but they include files which organize and check for you in the installation process as well as the files needed to run the program. This jumble will not run in this state. It needs to be 'compiled'.
Compiling
Source code is the basic code for a program before taking into account what system it is going to run on. The program won't run unless the files are first organized in a language that your system can use and into the right directories where the program can find them. You need a program to do that for you. This program is called a 'compiler'.Generally Puppy systems don't come with a program to make that happen. You need a compiling program to do that, for example devx_slacko_5.7.0.sfs. has the 'make' program in it. Different code writers have different procedures in compiling. So you need to know what method they use to know which commands to use at different points. Usually you need to do the compiling process through a terminal (console) with typed commands such as cmake, make, install, etc. You need to download a compiler which is sometimes specific to your particular puppy.
This compiling is done from the Console /terminal/Shell. Although recent versions of CMake do have a GUI (Graphical User Interface).
There are about six steps in the overall compiling process
1. Downloading the sources,
2. Unpacking the sources,
3. Creating a makefile, or configuring
4. Compiling,
5. Installing,
6. Deleting the sources.
The next three steps are:
1. configuration.The source package needs to be configured. A program needs to be run which goes and checks your system to see what it is, how it is structured, and what resources that the source is interested in, are present on the system . It will make some files with that information noted. Often that is in a makefile.txt file. If the source comes already configured, it is likely to have the makefile.txt file. It may come with a file called 'configure', in which case the command ./configure can be typed. (the dot means 'this directory', the slash means 'run or execute' a file, 'configure' means the file with the name 'configure'. That command will run the configure program. There may be a file called 'bootstrap' or even both. Bootstrap will do the same. If there is an 'autogen.sh' file, it also does basically the same as 'configure, (the .sh means it is a linux executable script . sh basically stands for 'shell' so it is a script the terminal can run with its built in commands.)
2.compile/build.
The compiling program (gcc ,make, CMake) will build or 'make' the program customized for your system, in doing so it makes a directory and writes, rewrites, and otherwise organizes the program according to what the configure program found. ( With this done a .pet can be made here)
3.Install.
The 'configured' and 'compiled/built/made' program, can be installed, usually with a 'make install' (without the quotes and a space between the two words) command in the terminal
Then all the source and intermediate files can be deleted as they have done their job.