centos - make install到底做什么操作?
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-04-25 09:01:08
0
2
1102

今天在安装redis的时候发现官方的文档上没有说要执行make install,直接cd 到src 目录里面执行redis-server文件就能启动。
而看很多别人的笔记呢,则都写了make install,发现实际就是把src目录下的几个二进制文件复制到了系统的/usr/local/bin下面了而已。
查了下似乎是说make install执行的是Makefile里面的脚本。
实际的作用也就是上面说的复制二进制文件么?
只是以redis的安装为例,主要是问安装程序时候的make install

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
给我你的怀抱

make install (对 make 命令来说)字面意思就是达成 install 这个目标。这个目标既然叫 install, of course, perform the software installation.

In UNIX-like systems, software installation usually optionally includes the following steps:

  • Copy the files to the corresponding directory
  • strip Remove unnecessary symbols from binary code files
  • Compress man document and info document
  • Update various indexes, mandb, info index, dynamic link library cache, software's own document directory, etc., depending on the needs of the software

Some UNIX-like system software does not require installation. You can use it directly by executing the executable file. Some are not like this. For example, the configuration files and resource files required by the software are not copied to the corresponding locations. The software including the dynamic link library needs to update the dynamic link library cache. Otherwise, an error will occur because the dynamic link library just compiled cannot be found, etc. wait.

伊谢尔伦

Excerpted from the official README:

To run Redis with the default configuration just type:

% cd src
% ./redis-server

Similarly,

In order to install Redis binaries into /usr/local/bin just use:

% make install

You can use "make PREFIX=/some/other/directory install" if you wish to use a
different destination.

Excerpted from https://github.com/antirez/redis/blob/3.0/Makefile

install:
    cd src && $(MAKE) $@

But this is just to execute the make install under the src directory.
After looking at the Makefile in the src/ folder, I executed the install command with /usr/local/bin as the directory parameter (default) for many things (please allow me not to list them one by one).

Remarks: Adding a parameter after make usually executes a certain target in the Makefile. For example, make install就是执行Makefile中install: is to execute a set of commands below install: in the Makefile.

Soinstall命令是什么呢?
man installwhat is the command?

man install and you will know:

This install copies files (usually just compiled files) to a destination of your choice.

For detailed information, get it yourself. 🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template