Linux编程基础:Makefile入门与常用命令详解

需积分: 24 1 下载量 178 浏览量 更新于2024-08-25 收藏 1.02MB PPT 举报
Makefile在Linux操作系统中的编程基础教程提供了一个很好的起点,对于初学者来说是不可或缺的资料。它介绍了一个核心的自动化工具——make,该命令默认会查找当前目录下的"GNUmakefile"、"makefile"和"Makefile",也可以指定其他名称,如"Make.Linux"。通过`make -f Make.Linux`,开发者可以调用Makefile进行构建过程的管理和控制。 章节涵盖了嵌入式Linux编程的基础内容,包括但不限于: 1. **基本命令**: - `login` 和 `logout`:用于登录和注销系统,`su` 切换用户权限,`dmesg` 显示开机信息。 - `ls`:查看目录内容,`ls -a` 显示所有文件(包括隐藏文件),`ls -l` 显示详细信息,如权限、用户、群组等。 - `clear` 清屏,`cd` 路径切换,`cat` 查看文件内容,`cp` 和 `mv` 复制和移动文件,`mkdir` 创建目录,`rm` 删除文件和目录,`man` 查阅手册,`grep` 搜索特定内容。 2. **文件系统**: 简要介绍了Linux文件系统的结构和常见目录的作用,以及如何理解文件的特性和权限。 3. **嵌入式交叉编译环境**: 专为嵌入式系统设计的编译环境,包括如何配置和使用以适应特定硬件平台的编译工具链。 4. **Vi编辑器**: 提及了Vi编辑器的基本使用,虽然不是Makefile本身的内容,但作为常见的Linux文本编辑器,了解其操作对编写Makefile至关重要。 通过学习这部分内容,初学者能够建立起对Linux命令行操作的熟悉度,掌握基础的文件管理技能,并理解如何利用Makefile进行项目构建流程的自动化。这对于任何从事Linux开发或系统管理的人来说都是一个良好的基础。在实际编程中,学会使用Makefile可以显著提高工作效率和代码组织能力。

sudo make install Making install in libfcgi make[1]: Entering directory '/home/yk/fcgi-2.4.1-SNAP-0910052249/libfcgi' make[2]: Entering directory '/home/yk/fcgi-2.4.1-SNAP-0910052249/libfcgi' test -z "/home/yk/fcgi/lib" || mkdir -p -- "/home/yk/fcgi/lib" /bin/bash ../libtool --mode=install /usr/bin/install -c 'libfcgi.la' '/home/yk/fcgi/lib/libfcgi.la' /usr/bin/install -c .libs/libfcgi.so.0.0.0 /home/yk/fcgi/lib/libfcgi.so.0.0.0 (cd /home/yk/fcgi/lib && { ln -s -f libfcgi.so.0.0.0 libfcgi.so.0 || { rm -f libfcgi.so.0 && ln -s libfcgi.so.0.0.0 libfcgi.so.0; }; }) (cd /home/yk/fcgi/lib && { ln -s -f libfcgi.so.0.0.0 libfcgi.so || { rm -f libfcgi.so && ln -s libfcgi.so.0.0.0 libfcgi.so; }; }) /usr/bin/install -c .libs/libfcgi.lai /home/yk/fcgi/lib/libfcgi.la /usr/bin/install -c .libs/libfcgi.a /home/yk/fcgi/lib/libfcgi.a chmod 644 /home/yk/fcgi/lib/libfcgi.a arm-xilinx-linux-gnueabi-ranlib /home/yk/fcgi/lib/libfcgi.a ../libtool: line 6556: arm-xilinx-linux-gnueabi-ranlib: command not found /bin/bash ../libtool --mode=install /usr/bin/install -c 'libfcgi++.la' '/home/yk/fcgi/lib/libfcgi++.la' libtool: install: warning: relinking `libfcgi++.la' (cd /home/yk/fcgi-2.4.1-SNAP-0910052249/libfcgi; /bin/bash ../libtool --tag=CXX --mode=relink arm-xilinx-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi -O2 -pipe -g -feliminate-unused-debug-types -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -o libfcgi++.la -lfcgi -rpath /home/yk/fcgi/lib fcgio.lo ) arm-xilinx-linux-gnueabi-g++ -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 --sysroot=/home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi -shared -nostdlib /home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/crti.o /home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/arm-xilinx-linux-gnueabi/8.2.0/crtbeginS.o .libs/fcgio.o -Wl,--rpath -Wl,/home/yk/fcgi/lib -L/home/yk/fcgi/lib -lfcgi -L/home/yk/sdk/sysroots/x86_64-petalinux-linux/usr/lib/arm-xilinx-linux-gnueabi/gcc/arm-xilinx-linux-gnueabi/8.2.0 -L/home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/lib -L/home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/arm-xilinx-linux-gnueabi/8.2.0 -L/home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib -lstdc++ -lm -lc -lgcc_s /home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/arm-xilinx-linux-gnueabi/8.2.0/crtendS.o /home/yk/sdk/sysroots/cortexa9t2hf-neon-xilinx-linux-gnueabi/usr/lib/crtn.o -march=armv7-a -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a9 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-soname -Wl,libfcgi++.so.0 -o .libs/libfcgi++.so.0.0.0 ../libtool: line 4501: arm-xilinx-linux-gnueabi-g++: command not found libtool: install: error: relink `libfcgi++.la' with the above command before installing it Makefile:256: recipe for target 'install-libLTLIBRARIES' failed make[2]: *** [install-libLTLIBRARIES] Error 1 make[2]: Leaving directory '/home/yk/fcgi-2.4.1-SNAP-0910052249/libfcgi' Makefile:459: recipe for target 'install-am' failed make[1]: *** [install-am] Error 2 make[1]: Leaving directory '/home/yk/fcgi-2.4.1-SNAP-0910052249/libfcgi' Makefile:373: recipe for target 'install-recursive' failed make: *** [install-recursive] Error 1

2023-07-21 上传