I as a regular and Linux to deal with the programmer, every time in the Linux installation software will be able to use--apt-get,yum,brew and other application manager to install, sometimes it backfired, you can only build and install ~WTF, said the beautiful world?
This time you will use the title:
Configure, make, made install these four instructions, whenever my hair is afraid, today I can not endure, I want to get them clear, so draw a whole noon time to study them well.
Do not say hundred to understand, but the next time to compile the installation, hey. Below share my harvest:
Later I found that it is not intuitive to say so directly, but also found that I do not have vim on Ubuntu, simply: I use the method of compiling vim, with these words, I hope you can see with clear!
1. Source Files
I use Git clone under Vim's source file
git clone https://github.com/vim/vim.git
The source files for Vim are as follows:
This time you down (keyword--git clone or wget or curl) get the file, there may be a compression package. It can also be a bunch of files (git clone down)
2.configure
General on-Line steps:
./configure--here Novice may not be able to execute, here explain "./"--the current directory meaning, this is the relative path. Search keywords: absolute path and relative path
Configure: is a shell script that is in the root directory of the source file. His role is to check if you have a system that compiles other libraries that the program relies on.
If you have a small partner with a large game installed under Windows, you know that feeling. If the Configure script checks that the compilation environment is incomplete (the other software that you need is not installed or cannot be found-the path is not connected).
Will be interrupted, you must resolve the error it reports, in order to proceed to the next step.
Note: prefix parameter--Specify the installation path (where to install), this must be specified, otherwise you do not know the default installation to where, inconvenient later management
Other parameters--search keywords: Configure parameters
Below I run: Configure script and add prefix parameter (I want to install to Root/learn_install directory):
Trouble checking the environment (this is the need to rely on other libraries):
After the search, the solution is as follows:
After installing the terminal library, rerun the Configure script and succeed!
The Make tool is sourced because:
The source file is a lot of things is really a headache. Fortunately, the utility make can help us solve both of these problems-when the program's source file changes, it ensures that all the affected files will be recompiled, and that the unaffected files are not compiled, which is great.
Make
The most basic function of the make instruction is to describe the relationship between source programs through the makefile file and to automatically maintain the work of the compilation.
Makefile: This file is written in a specific syntax, and the file explains how to compile the individual source files and link them to the executable file, and ask to define
Dependency between source files.
Simply put, define the dependencies between the source files and compile (this is compile, not check).
I think it is equivalent to: Compile all the modules in the import, so that the execution of the source file, it can be executed smoothly ~ (I am pythoner,c++ seems to be include)
Make Complete:
Make install:
After the execution of this command, the installation is complete, you will find that in the execution of configure prefix the specified installation path, there is a ~
Here is the first step I performed:
Below I run: Configure script and add prefix parameter (I want to install to Root/learn_install directory):
The results are as follows:
Vim is in the bin directory. Execution:/root/learn_install/bin/vim
But there is one last question, usually when we use VIM, no matter where we enter: Vim can, but now it is not. Can only be executed under this/root/learn_install/bin directory./vim.
This is because:
The instructions you type are found in these directories, so enter vim and he still prompts you not to install.
So we can create a soft connection to the/usr/bin directory:
Keywords: ln soft link
This is not my sentimental ah, I generally use the VI directive, but VIM is the upgrade version of VI I do not have to put plus, so search, keywords: alias
Input: Alais vi= "Vim" (this way fails after reboot)
OK, this time where you enter VI can be, hey
[Linux notes] clear the Linux installer (configure, make, make install)