1. Skip to main text

        GNU Make

        GNU Make is a tool which controls the generation of executables and othernon-source files of a program from the program's source files.

        Make gets its knowledge of how to build your program from a filecalled the makefile, which lists each of the non-source filesand how to compute it from other files. When you write a program, youshould write a makefile for it, so that it is possible to use Make tobuild and install the program.

        Capabilities of Make

        Make Rules and Targets

        A rule in the makefile tells Make how to execute a series ofcommands in order to build a target file from source files.It also specifies a list of dependencies of the target file.This list should include all files (whether source files or other targets)which are used as inputs to the commands in the rule.

        Here is what a simple rule looks like:

        target:   dependencies ...          commands          ...

        When you run Make, you can specify particular targets to update;otherwise, Make updates the first target listed in the makefile. Ofcourse, any other target files needed as input for generating thesetargets must be updated first.

        Make uses the makefile to figure out which target files ought to bebrought up to date, and then determines which of them actually need tobe updated. If a target file is newer than all of its dependencies,then it is already up to date, and it does not need to be regenerated.The other target files do need to be updated, but in the right order:each target file must be regenerated before it is used in regeneratingother targets.

        Advantages of GNU Make

        GNU Make has many powerful features for use in makefiles, beyond whatother Make versions have. It can also regenerate, use, and then deleteintermediate files which need not be saved.

        GNU Make also has a few simple features that are very convenient. Forexample, the -o file option which says ``pretend thatsource file file has not changed, even though it has changed.''This is extremely useful when you add a new macro to a header file.Most versions of Make will assume they must therefore recompile all thesource files that use the header file; but GNU Make gives you a way toavoid the recompilation, in the case where you know your change to theheader file does not require it.

        However, the most important difference between GNU Make and mostversions of Make is that GNU Make is free software.

        Makefiles And Conventions

        We have developed conventions for how to write Makefiles, which allGNU packages ought to follow. It is a good idea to follow theseconventions in your program even if you don't intend it to be GNUsoftware, so that users will be able to build your package justlike many other packages, and will not need to learn anything specialbefore doing so.

        These conventions are found in the chapter``Makefile conventions'' (147 kcharacters) of the GNU CodingStandards (147 k characters).

        Downloading Make

        Makecan be found on the main GNU ftp server:http://ftp.gnu.org/gnu/make/(via HTTP) andftp://ftp.gnu.org/gnu/make/(via FTP). It can also be foundon the GNU mirrors;pleaseusea mirror if possible.

        Documentation

        Documentation forMakeis available online, asis documentation for most GNU software. You mayalso find more information aboutMakeby runninginfo makeorman make,or by looking at/usr/share/doc/make/,/usr/local/doc/make/,or similar directories on your system. A brief summary is available byrunning make --help.

        Mailing lists

        Makehas the following mailing lists:

        Announcements aboutMakeand most other GNU software are made oninfo-gnu(archive).

        Security reports that should not be made immediately public can besent directly to the maintainer. If there is no response to an urgentissue, you can escalate to the generalsecuritymailing list for advice.

        Getting involved

        Development ofMake,and GNU in general, is a volunteer effort, and you can contribute. Forinformation, please read How to help GNU. If you'dlike to get involved, it's a good idea to join the discussion mailinglist (see above).

        Test releases
        Trying the latest test release (when available) is alwaysappreciated. Test releases ofMakecan be found athttp://alpha.gnu.org/gnu/make/(via HTTP) andftp://alpha.gnu.org/gnu/make/(via FTP).
        Development
        For development sources, issue trackers, and otherinformation, please see theMakeproject pageat savannah.gnu.org.
        Translating Make
        To translateMake'smessages into other languages, please see the Translation Projectpage forMake.If you have a new translation of the message strings,or updates to the existing strings, please have the changes made in thisrepository. Only translations from this site will be incorporated intoMake.For more information, see the TranslationProject.
        Maintainer
        Makeis currently being maintained byPaul Smith.Please use the mailing lists for contact.

        Licensing

        Makeis free software; you can redistribute it and/or modify it under theterms of the GNU General Public License as published by the FreeSoftware Foundation; either version 3 of the License, or (at youroption) any later version.

         [FSF logo] “The Free Software Foundation (FSF) is a nonprofit with a worldwidemission to promote computer user freedom. We defend the rights of allsoftware users.”

            1. http://www.rd247nt8.tw | http://m.rd247nt8.tw | http://wap.rd247nt8.tw | http://3g.rd247nt8.tw | http://4g.rd247nt8.tw | http://5g.rd247nt8.tw | http://mobile.rd247nt8.tw | http://vip.rd247nt8.tw | http://ios.rd247nt8.tw | http://anzhuo.rd247nt8.tw | http://7.rd247nt8.tw | http://03e618.rd247nt8.tw | http://9a32e0.rd247nt8.tw | http://5.rd247nt8.tw | http://e.rd247nt8.tw | http://566ad.rd247nt8.tw | 乖放松太紧了疼忍一下