badfacebook.blogg.se

Makefile for c program executable command
Makefile for c program executable command





makefile for c program executable command makefile for c program executable command

Phony targets, using the PHONY attribute.įor example, to build an executable from the source code in Example 1-4 using GCC, your makefile might The clean and install targets should both be labeled as Its command script should remove the executable and the intermediate objectįile from the current directory. Prerequisites, and should have a command script to copy the executable from the directoryĬontaining the makefile to the directory where you want it installed. Specify yourĪpplication’s source file as its prerequisite, and specify the command line needed toīuild the executable from the source file as your target’s command script. Give the second target the same name as your executable. The name of the executable you wish to build as its sole prerequisite. Create a text file named makefile in the directory containing your source file. In the following examples, lines which begin with a Tab are indicated by an With a Tab rather than a Space - this is a source of some of the most common beginnerĮrrors.

makefile for c program executable command

Lines containing command scripts must begin







Makefile for c program executable command