A Makefile is a text file that contains rules that tell Linux's make utility how to build an application. The rules are made up of three parts: Target: The file or thing that must be made Prerequisites: The files that must exist before the target can be created Commands: The shell commands that will create the target from the prerequisites The basic syntax for a Makefile is: target, dependencies, and commands. The dependency line in a Makefile has two parts: Target files: The first part of the dependency line, before the colon Source files: The second part of the dependency line,... Show more A Makefile is a text file that contains rules that tell Linux's make utility how to build an application. The rules are made up of three parts: Target: The file or thing that must be made Prerequisites: The files that must exist before the target can be created Commands: The shell commands that will create the target from the prerequisites The basic syntax for a Makefile is: target, dependencies, and commands. The dependency line in a Makefile has two parts: Target files: The first part of the dependency line, before the colon Source files: The second part of the dependency line, after the colon Multiple target files must be separated by a space. Here's an example of a Makefile that describes how an executable file called edit depends on eight object files: edit : main.o kbd.o command.o display.o \ insert.o search.o files.o utils.o cc -o edit main.o To execute the commands in the makefile, type make in the directory containing the makefile. You can create a makefile using nano, vim, vi, gedit, cat, and other tools. The name of the file must either be “Makefile” or “makefile”. Show less
A Makefile is a text file that contains rules that tell Linux's make utility how to build an application. The rules are made up of three parts: Target: The file or thing that must be made Prerequisites: The files that must exist before the target can be created Commands: The shell commands that will create the target from the prerequisites
The basic syntax for a Makefile is: target, dependencies, and commands.
The dependency line in a Makefile has two parts: Target files: The first part of the dependency line, before the colon Source files: The second part of the dependency line, after the colon Multiple target files must be separated by a space.
Here's an example of a Makefile that describes how an executable file called edit depends on eight object files: edit : main.o kbd.o command.o display.o \ insert.o search.o files.o utils.o cc -o edit main.o To execute the commands in the makefile, type make in the directory containing the makefile. You can create a makefile using nano, vim, vi, gedit, cat, and other tools. The name of the file must either be “Makefile” or “makefile”.
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.