Tarball compilation and installation and upgrade-make and patch 1. Concept: Compile the source code into an executable program of a binary mechanism. make and the detection program generate the makefile of the compilation connection file together with config, then, makefile is compiled into an executable file. Tarball is actually a tar package and compressed package of the original code. Rpm refers to the packages that are compiled and released by linux merchants for a long time, but different types of systems cannot be used. The function library www.2cto.com provides external calls, a bit like a dll. 2. gcc is the C statement compiler. It is usually compiled into the target file first and then linked into an executable file. 3. make can be easily compiled because it writes the commands and sequences to be compiled to the makefile file. Www.2cto.com 4. Put the makefile file in the first-level directory of the program's original code. Its Syntax: [root @ www ~] # Vi makefileLIBS =-lm # This is the variable OBJS = main. o haha. o sin_value.o cos_value.oCFLAGS =-Wallmain :$ {OBJS} gcc-o $ {OBJS }$ {LIBS} <== that $ @ is main! $ @ Indicates the current target clean: rm-f main $ {OBJS} # MARK: the source code file with relevance # tab at the beginning of the second line, this line is the executed command, such as script command 5. The specific directory rules are as follows: a. It is best to extract the original tarball data to/usr/local/src; B. During installation, it is best to install the software in the default path of/usr/local. c. Consider future anti-installation steps. It is best to install each software separately under/usr/local; d. Add man path search to the man page of the software installed in a separate directory: if the software you installed is stored in/usr/local/software/, the man page search settings are as follows, it may have to be in/etc/man. 40 ~ in config ~ At about 50 lines, write the following line: MANPATH/usr/local/software/man to query online files of the software! 6. Detect the configuration program. /configure -- help, you can view the support parameters and descriptions of the general parameters are installed to which directory parameters: -- prefix =/path 7, general steps (using ntp as an example ): cd/usr/local/src tar-zxvf/root/ntp-4.2.4p7.tar.gz cd ntp-4.2.4p7/cat INSTALL. /configure -- help | more. /configure -- prefix =/usr/local/ntpmake clean; makemake check # If this step is not detected, make install 8 and update the original code: a, cat ~ /Main_0.20.to_0.2.patch # Check the relative directory B of the first line and update it with the patch-p number <patch_file. The number here indicates that the old directory should be removed from several /, if not, use patch-p1 <patch_file, which must be determined by step. For example, compare main-0.1/xxx with main-0.2/xxx, and you are now in the main-0.1 directory, So patch-p1 <.. /main_0.20.to_0.2.patch c. The update package is usually released. A patch is a suffix that indicates the version to which the patch is to be updated. If the patch cannot be upgraded across multiple versions, it must be upgraded in sequence. For example, if multiple update packages are used, update the previous update packages one by one. d and make clean; make check # If this step is not detected, make install. If an error is reported, you may need to execute it. /configure and patch only update the changed original code. E. What if the patch is incorrect? Our patch can be restored! Use patch-R <../main_0.20.to_0.2.patch. (Main_0.20.to_0.2.patch is just an example)