text: The Makefile and Compilation Tutorial - CSDN博客
  转载 2004年09月10日 11:28:00
  The first thing to remember about compiling, as with all things in computers, is Don't Panic! This will become second nature all too soon. The second thing to know about compiling is that when you write a program, you generally have nothing more than a text file which is no different to the computer than a letter that you typed to your great aunt Betsy. The computer has no idea what to do with a text file. To the computer, the text file is just data. You've got to compile your program into an executable code which the computer can understand. (There are such things as interpreted languages — languages where your code is compiled as it is executed, but they don't count here since you don't compile them yourself.)
  The third thing to know about compiling is that there are generally three distinct steps in compiling some code to an executable. They are:
  Example: Suppose the source code for an executable binary file named project.exe is stored in a file named project.cpp. The program #includes a library's header file named lib.h and the library's implementation file is named lib.cpp. Please download source_lab04_project.cpp and rename it to project.cpp. Then, do the same for source_lab04_lib.h and source_lab04_lib.cpp (renaming them to lib.h and lib.cpp, respectively).
  In some systems, these steps are carried out automatically by selecting the appropriate menu command — for example, Build project.exe on the Build menu in Microsoft's Visual C++ and the Make or (Run) command on the Project menu in Metrowerks' CodeWarrior C++.
  If a program involves several different libraries, it can be very difficult to keep track of which files are out of date, which need to be recompiled, and so on. Single commands like the preceding that do this automatically are very usefull in this regard. With GNU C++, UNIX's make utility can be used to execute a file named Makefile that contains the commands for the compilations and linking.
  UNIX's make Utility
  Using the make utility requires a programmer to create a special file named Makefile, from which the make program reads information. A Makefile consists of pairs of lines (each pair governs the updating of one file).
  Upon what files does project.exe depend?
  → project.o and lib.o
  (This means project.exe won't compile without project.o and lib.o)
  Upon what files does project.o depend?
  → project.cpp and lib.h
  Upon what files does lib.o depend?
  → lib.cpp and lib.h
  A Makefile has one pair of lines for each file to be "made", so our example Makefile will have three line-pairs (one for project.exe, one for project.o and one for lib.o). Create a Makefile now by typing emacs Makefile & at the unix prompt.
  The first line of each line-pair in a Makefile has the form:
  The second line of the pair is a UNIX command to make TargetFile. The command must be preceded by a TAB and end with a Return.
  To illustrate: The first line-pair in our Makefile appears as follows:
  Of course, project.o won't exist the first time we compile, so we should specify a line-pair for it, too:
  Now, when a user types
  Since a Makefile coordinates the translation of one project, each project should be stored in its own dedicated directory, with a separate Makefile to coordinate its translation. Doing so allows you to remove the object files, binary executables, etc., because to remake the project, you need only cd to the directory and type make.
  An added benefit is that all the files for one project are confined within one directory, making it easier to port the project to a different machine. (Just copy the directory to the new machine, cd to the directory, and type make).
  Hand In: This lab handout with the answers filled in attached to a listing of your final Makefile
  (use the enscript command from your Programming Style Sheet to print it out:
  enscript -E -G -2rj -M Letter -PECT2_PS <filename>).
  Ubuntu server常见问题
  yexiang@ubuntu:~/uboot$ arm-linux-g++ -v/opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-g++: 15: exe...
  201711学习笔记
  20171114转做语义分割了,第一个任务,测试PSPnet。首先,在caffe下搭建PSPnet。。。 pyramid scene parsing network (PSPNet) 一篇介绍文章:...
  sinat_26871259
  makefile学习资料
  (Makefile Tutorial) http://mrbook.org/tutorials/make/ (Write Makefile with me) http://bbs.chinau...
  2013年08月07日 08:54
  makefile很重要 什么是makefile?或许很多Winodws的程序员都不知道这个东西,因为那些Windows的IDE都为你做了这个工作,但我觉得要作一个好的和professional的程序...
  ziliangxiao
  makefile 自动生成头文件依赖关系
  在使用makefile 自动生成头文件依赖是,大家多半使用了下面这个方法。 sinclude $(CUR_OBJS:.o=.d) %.d:%.c @set -e; rm -f $@; \ ...
  http://oucsace.cs.ohiou.edu/~bhumphre/makefile.html Makefile Getting Started What is Make? ...
  eclipse中maven Compilation failure::[4,29] 程序包cms_mr.job.mrprovider不存在
  [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-c...