SlideShare une entreprise Scribd logo
1  sur  77
Télécharger pour lire hors ligne
Introduction to Makefile

        Ray Song


    February 25, 2012




     Ray Song   Introduction to Makefile
Motivation




      Small programs -> single file -> manual compilation
      “not so small” programs
             many files
             multiple components
             more than one programmers




                            Ray Song     Introduction to Makefile
Motivation




      Small programs -> single file -> manual compilation
      “not so small” programs
             many files
             multiple components
             more than one programmers




                            Ray Song     Introduction to Makefile
Motivation




      Small programs -> single file -> manual compilation
      “not so small” programs
             many files
             multiple components
             more than one programmers




                            Ray Song     Introduction to Makefile
Motivation




      Small programs -> single file -> manual compilation
      “not so small” programs
             many files
             multiple components
             more than one programmers




                            Ray Song     Introduction to Makefile
Motivation




      Small programs -> single file -> manual compilation
      “not so small” programs
             many files
             multiple components
             more than one programmers




                            Ray Song     Introduction to Makefile
Motivation - cont.




       Problems
           harder to manage
           every change require long compilation
           division to components is desired




                            Ray Song   Introduction to Makefile
Motivation - cont.




       Problems
           harder to manage
           every change require long compilation
           division to components is desired




                            Ray Song   Introduction to Makefile
Motivation - cont.




       Problems
           harder to manage
           every change require long compilation
           division to components is desired




                            Ray Song   Introduction to Makefile
Motivation - cont.




       Problems
           harder to manage
           every change require long compilation
           division to components is desired




                            Ray Song   Introduction to Makefile
Motivation - cont.




       Solution - Makefile




                            Ray Song   Introduction to Makefile
Makefile




     Makefile describes
          project structure
          instructions for files creation
     A makefile consists of many rules.




                             Ray Song   Introduction to Makefile
Makefile




     Makefile describes
          project structure
          instructions for files creation
     A makefile consists of many rules.




                             Ray Song   Introduction to Makefile
Makefile




     Makefile describes
          project structure
          instructions for files creation
     A makefile consists of many rules.




                             Ray Song   Introduction to Makefile
Makefile




     Makefile describes
          project structure
          instructions for files creation
     A makefile consists of many rules.




                             Ray Song   Introduction to Makefile
Rule syntax



      TARGETS: PREREQUISITES

          RECIPE

      In short, each rule describe instructions (RECIPE) to create
      files (TARGETS) with PREREQUISITES.
      PREREQUISITES are targets must be created prior to
      TARGETS.
      A target is considered old if its modification timestamp is
      smaller than one of its dependencies’s.




                           Ray Song   Introduction to Makefile
Rule syntax



      TARGETS: PREREQUISITES

          RECIPE

      In short, each rule describe instructions (RECIPE) to create
      files (TARGETS) with PREREQUISITES.
      PREREQUISITES are targets must be created prior to
      TARGETS.
      A target is considered old if its modification timestamp is
      smaller than one of its dependencies’s.




                           Ray Song   Introduction to Makefile
Rule syntax



      TARGETS: PREREQUISITES

          RECIPE

      In short, each rule describe instructions (RECIPE) to create
      files (TARGETS) with PREREQUISITES.
      PREREQUISITES are targets must be created prior to
      TARGETS.
      A target is considered old if its modification timestamp is
      smaller than one of its dependencies’s.




                           Ray Song   Introduction to Makefile
Makefile – cont.



      TARGETS and PREREQUISITES are file names separated
      by spaces.
      Usually there is only one target per rule.
      TARGETS and PREREQUISITES may contain wildcards,
      e.g. %.c.
      Each line of RECIPE starts with a TAB.
      The first rule indicates the default target (not counting
      targets that contain wildcards).




                           Ray Song   Introduction to Makefile
Makefile – cont.



      TARGETS and PREREQUISITES are file names separated
      by spaces.
      Usually there is only one target per rule.
      TARGETS and PREREQUISITES may contain wildcards,
      e.g. %.c.
      Each line of RECIPE starts with a TAB.
      The first rule indicates the default target (not counting
      targets that contain wildcards).




                           Ray Song   Introduction to Makefile
Makefile – cont.



      TARGETS and PREREQUISITES are file names separated
      by spaces.
      Usually there is only one target per rule.
      TARGETS and PREREQUISITES may contain wildcards,
      e.g. %.c.
      Each line of RECIPE starts with a TAB.
      The first rule indicates the default target (not counting
      targets that contain wildcards).




                           Ray Song   Introduction to Makefile
Makefile – cont.



      TARGETS and PREREQUISITES are file names separated
      by spaces.
      Usually there is only one target per rule.
      TARGETS and PREREQUISITES may contain wildcards,
      e.g. %.c.
      Each line of RECIPE starts with a TAB.
      The first rule indicates the default target (not counting
      targets that contain wildcards).




                           Ray Song   Introduction to Makefile
Makefile – cont.



      TARGETS and PREREQUISITES are file names separated
      by spaces.
      Usually there is only one target per rule.
      TARGETS and PREREQUISITES may contain wildcards,
      e.g. %.c.
      Each line of RECIPE starts with a TAB.
      The first rule indicates the default target (not counting
      targets that contain wildcards).




                           Ray Song   Introduction to Makefile
make’s mechanism

     make command reads a makefile and records these rules into
     its data base.
     GNU Make defaults to search GNUmakefile, makefile,
     Makefile in order, use the first of these which exists.
     The first goal (terminology used to refer to the list of targets
     you specified on the command line) should be created.
     Prerequisites which appeared in the target must be processed
     first.
     This is a recursive process (depth first search).
     After updating the dependencies , make decides whether it is
     necessary to recreated the target. This is the case when it is
     older than one of its dependencies. In the case we recreate
     the target, execute the associated recipe.

                          Ray Song   Introduction to Makefile
make’s mechanism

     make command reads a makefile and records these rules into
     its data base.
     GNU Make defaults to search GNUmakefile, makefile,
     Makefile in order, use the first of these which exists.
     The first goal (terminology used to refer to the list of targets
     you specified on the command line) should be created.
     Prerequisites which appeared in the target must be processed
     first.
     This is a recursive process (depth first search).
     After updating the dependencies , make decides whether it is
     necessary to recreated the target. This is the case when it is
     older than one of its dependencies. In the case we recreate
     the target, execute the associated recipe.

                          Ray Song   Introduction to Makefile
make’s mechanism

     make command reads a makefile and records these rules into
     its data base.
     GNU Make defaults to search GNUmakefile, makefile,
     Makefile in order, use the first of these which exists.
     The first goal (terminology used to refer to the list of targets
     you specified on the command line) should be created.
     Prerequisites which appeared in the target must be processed
     first.
     This is a recursive process (depth first search).
     After updating the dependencies , make decides whether it is
     necessary to recreated the target. This is the case when it is
     older than one of its dependencies. In the case we recreate
     the target, execute the associated recipe.

                          Ray Song   Introduction to Makefile
make’s mechanism

     make command reads a makefile and records these rules into
     its data base.
     GNU Make defaults to search GNUmakefile, makefile,
     Makefile in order, use the first of these which exists.
     The first goal (terminology used to refer to the list of targets
     you specified on the command line) should be created.
     Prerequisites which appeared in the target must be processed
     first.
     This is a recursive process (depth first search).
     After updating the dependencies , make decides whether it is
     necessary to recreated the target. This is the case when it is
     older than one of its dependencies. In the case we recreate
     the target, execute the associated recipe.

                          Ray Song   Introduction to Makefile
make’s mechanism

     make command reads a makefile and records these rules into
     its data base.
     GNU Make defaults to search GNUmakefile, makefile,
     Makefile in order, use the first of these which exists.
     The first goal (terminology used to refer to the list of targets
     you specified on the command line) should be created.
     Prerequisites which appeared in the target must be processed
     first.
     This is a recursive process (depth first search).
     After updating the dependencies , make decides whether it is
     necessary to recreated the target. This is the case when it is
     older than one of its dependencies. In the case we recreate
     the target, execute the associated recipe.

                          Ray Song   Introduction to Makefile
make’s mechanism

     make command reads a makefile and records these rules into
     its data base.
     GNU Make defaults to search GNUmakefile, makefile,
     Makefile in order, use the first of these which exists.
     The first goal (terminology used to refer to the list of targets
     you specified on the command line) should be created.
     Prerequisites which appeared in the target must be processed
     first.
     This is a recursive process (depth first search).
     After updating the dependencies , make decides whether it is
     necessary to recreated the target. This is the case when it is
     older than one of its dependencies. In the case we recreate
     the target, execute the associated recipe.

                          Ray Song   Introduction to Makefile
make’s mechanism - cont.



      make virtually construct a dependency DAG (directed acyclic
      graph).
      make ensures minimum compilation as long as the project
      structure is written properly.
      Do not write something like:
          prog: main.c sum1.c sum2.c
               gcc –o prog main.c sum1.c sum2.c
      which requires compilation of all project when something is
      changed




                           Ray Song   Introduction to Makefile
make’s mechanism - cont.



      make virtually construct a dependency DAG (directed acyclic
      graph).
      make ensures minimum compilation as long as the project
      structure is written properly.
      Do not write something like:
          prog: main.c sum1.c sum2.c
               gcc –o prog main.c sum1.c sum2.c
      which requires compilation of all project when something is
      changed




                           Ray Song   Introduction to Makefile
make’s mechanism - cont.



      make virtually construct a dependency DAG (directed acyclic
      graph).
      make ensures minimum compilation as long as the project
      structure is written properly.
      Do not write something like:
          prog: main.c sum1.c sum2.c
               gcc –o prog main.c sum1.c sum2.c
      which requires compilation of all project when something is
      changed




                           Ray Song   Introduction to Makefile
make’s mechanism - cont.



      make virtually construct a dependency DAG (directed acyclic
      graph).
      make ensures minimum compilation as long as the project
      structure is written properly.
      Do not write something like:
          prog: main.c sum1.c sum2.c
               gcc –o prog main.c sum1.c sum2.c
      which requires compilation of all project when something is
      changed




                           Ray Song   Introduction to Makefile
make’s mechanism - cont.



      make virtually construct a dependency DAG (directed acyclic
      graph).
      make ensures minimum compilation as long as the project
      structure is written properly.
      Do not write something like:
          prog: main.c sum1.c sum2.c
               gcc –o prog main.c sum1.c sum2.c
      which requires compilation of all project when something is
      changed




                           Ray Song   Introduction to Makefile
make’s mechanism - cont.



      make virtually construct a dependency DAG (directed acyclic
      graph).
      make ensures minimum compilation as long as the project
      structure is written properly.
      Do not write something like:
          prog: main.c sum1.c sum2.c
               gcc –o prog main.c sum1.c sum2.c
      which requires compilation of all project when something is
      changed




                           Ray Song   Introduction to Makefile
Automatic variables




      $@
      $ˆ
      $<
      others including $, $?, $+, $|, $%, $(%D), %(F), . . .




                           Ray Song   Introduction to Makefile
Automatic variables




      $@
      $ˆ
      $<
      others including $, $?, $+, $|, $%, $(%D), %(F), . . .




                           Ray Song   Introduction to Makefile
Automatic variables




      $@
      $ˆ
      $<
      others including $, $?, $+, $|, $%, $(%D), %(F), . . .




                           Ray Song   Introduction to Makefile
Automatic variables




      $@
      $ˆ
      $<
      others including $, $?, $+, $|, $%, $(%D), %(F), . . .




                           Ray Song   Introduction to Makefile
Example



     convert: cmdline.o convert.o
          g++ $ˆ -o $@

     convert.o: convert.cpp convert.h

          g++ -c $<

     cmdline.o: cmdline.cpp cmdline.h convert.h

          g++ -c $<




                         Ray Song   Introduction to Makefile
Equivalent (implicit rules)




       make can dedude appropriate recipes according to suffixes

       convert: cmdline.o convert.o
       convert.o: convert.cpp convert.h

       cmdline.o: cmdline.cpp cmdline.h convert.h




                           Ray Song   Introduction to Makefile
Equivalent (implicit rules) - cont.




       convert: cmdline.o
       convert.o: convert.h
       cmdline.o: cmdline.h convert.h




                              Ray Song   Introduction to Makefile
Another example




      %.o: %.c
          gcc -c $<




                      Ray Song   Introduction to Makefile
Passing parameters




      test: FORCE
          echo $(VAR)

      FORCE:

      make VAR=hello
      make VAR=world




                        Ray Song   Introduction to Makefile
Passing parameters




      test: FORCE
          echo $(VAR)

      FORCE:

      make VAR=hello
      make VAR=world




                        Ray Song   Introduction to Makefile
Force targets




       Targets without recipes or prerequisites




                            Ray Song   Introduction to Makefile
Phony targets




      They do not correspond to real file.
      Provide some utility, e.g. cleaning intermediate files, archiving
      the whole project, creating TAGS file for some editors
      Forced to run its recipe upon executing.




                           Ray Song   Introduction to Makefile
Phony targets




      They do not correspond to real file.
      Provide some utility, e.g. cleaning intermediate files, archiving
      the whole project, creating TAGS file for some editors
      Forced to run its recipe upon executing.




                           Ray Song   Introduction to Makefile
Phony targets




      They do not correspond to real file.
      Provide some utility, e.g. cleaning intermediate files, archiving
      the whole project, creating TAGS file for some editors
      Forced to run its recipe upon executing.




                           Ray Song   Introduction to Makefile
Example


     all : prog1 prog2 prog3

     .PHONY : all
     prog1 : prog1.o utils.o

          cc -o prog1 prog1.o utils.o

     prog2 : prog2.o

          cc -o prog2 prog2.o

     prog3 : prog3.o sort.o utils.o

          cc -o prog3 prog3.o sort.o utils.o



                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Practical options of make



      -n, print the commands to be run but do not execute them
      -t, touch files instead of running the recipes
      -B, unconditionally make all targets (overide timestamps)
      -W file, pretend file has been just modified
      -p, print the data base that results from reading the makefiles
      -d, debug mode
      others, RTFM




                           Ray Song   Introduction to Makefile
Other usage




      Makefile’s mechanism is not limited to programs
          LaTeX sources
          website deployment
          describe any task where some files need updating as a result of
          changes of other files




                           Ray Song   Introduction to Makefile
Other usage




      Makefile’s mechanism is not limited to programs
          LaTeX sources
          website deployment
          describe any task where some files need updating as a result of
          changes of other files




                           Ray Song   Introduction to Makefile
Other usage




      Makefile’s mechanism is not limited to programs
          LaTeX sources
          website deployment
          describe any task where some files need updating as a result of
          changes of other files




                           Ray Song   Introduction to Makefile
Other usage




      Makefile’s mechanism is not limited to programs
          LaTeX sources
          website deployment
          describe any task where some files need updating as a result of
          changes of other files




                           Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Additional features

       Variables (two flavors: simple and recursive, the latter is also
       called macros)
       Functions including string substitution, file name
       manipulation, foreach, even the the root of evil – eval
       VPATH
       Ability to manipulate archives(.a)
       Including other makefiles
       Conditionals
       Secondary expansion
       Order-only prerequisites
       Static patterns
       Double-colon rules
       Target/pattern-specific variable values

                             Ray Song   Introduction to Makefile
Acknowledgements



      This slide incorporate some stuff from Roded Sharan’s
      http://www.cs.tau.ac.il/~roded/courses/softp-b06/
      Makefile.ppt
      Markdown
      http://daringfireball.net/projects/markdown/ in
      which this slide source is written.
      Pandoc http://johnmacfarlane.net/pandoc/ by which
      this slide is generated.
      Haskell http://www.haskell.org/ in which Pandoc is
      implemented.




                        Ray Song   Introduction to Makefile
Acknowledgements



      This slide incorporate some stuff from Roded Sharan’s
      http://www.cs.tau.ac.il/~roded/courses/softp-b06/
      Makefile.ppt
      Markdown
      http://daringfireball.net/projects/markdown/ in
      which this slide source is written.
      Pandoc http://johnmacfarlane.net/pandoc/ by which
      this slide is generated.
      Haskell http://www.haskell.org/ in which Pandoc is
      implemented.




                        Ray Song   Introduction to Makefile
Acknowledgements



      This slide incorporate some stuff from Roded Sharan’s
      http://www.cs.tau.ac.il/~roded/courses/softp-b06/
      Makefile.ppt
      Markdown
      http://daringfireball.net/projects/markdown/ in
      which this slide source is written.
      Pandoc http://johnmacfarlane.net/pandoc/ by which
      this slide is generated.
      Haskell http://www.haskell.org/ in which Pandoc is
      implemented.




                        Ray Song   Introduction to Makefile
Acknowledgements



      This slide incorporate some stuff from Roded Sharan’s
      http://www.cs.tau.ac.il/~roded/courses/softp-b06/
      Makefile.ppt
      Markdown
      http://daringfireball.net/projects/markdown/ in
      which this slide source is written.
      Pandoc http://johnmacfarlane.net/pandoc/ by which
      this slide is generated.
      Haskell http://www.haskell.org/ in which Pandoc is
      implemented.




                        Ray Song   Introduction to Makefile
References




      GNU Make Manual
      http://www.gnu.org/software/make/manual/




                      Ray Song   Introduction to Makefile

Contenu connexe

Tendances

Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo PlatformJeremiah Foster
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packagesJeremiah Foster
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with PuppetAlessandro Franceschi
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projectsMpho Mphego
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package developmentTihomir Opačić
 
Composer the right way - SunshinePHP
Composer the right way - SunshinePHPComposer the right way - SunshinePHP
Composer the right way - SunshinePHPRafael Dohms
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHPNick Belhomme
 
Puppetizing Your Organization
Puppetizing Your OrganizationPuppetizing Your Organization
Puppetizing Your OrganizationRobert Nelson
 
2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slides2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slidesMasterCode.vn
 
PhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 PluginPhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 PluginHaehnchen
 
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondPloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondDavid Glick
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python MeetupAreski Belaid
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
Creating a Plug-In Architecture
Creating a Plug-In ArchitectureCreating a Plug-In Architecture
Creating a Plug-In Architectureondrejbalas
 
PHPUnit with CakePHP and Yii
PHPUnit with CakePHP and YiiPHPUnit with CakePHP and Yii
PHPUnit with CakePHP and Yiimadhavi Ghadge
 
Simplify writing code with deliberate commits
Simplify writing code with deliberate commitsSimplify writing code with deliberate commits
Simplify writing code with deliberate commitsJoel Chippindale
 

Tendances (20)

Packaging for the Maemo Platform
Packaging for the Maemo PlatformPackaging for the Maemo Platform
Packaging for the Maemo Platform
 
The Gory Details of Debian packages
The Gory Details of Debian packagesThe Gory Details of Debian packages
The Gory Details of Debian packages
 
Developing IT infrastructures with Puppet
Developing IT infrastructures with PuppetDeveloping IT infrastructures with Puppet
Developing IT infrastructures with Puppet
 
Makefile for python projects
Makefile for python projectsMakefile for python projects
Makefile for python projects
 
Laravel 4 package development
Laravel 4 package developmentLaravel 4 package development
Laravel 4 package development
 
Composer the right way - SunshinePHP
Composer the right way - SunshinePHPComposer the right way - SunshinePHP
Composer the right way - SunshinePHP
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Installing AtoM with Ansible
Installing AtoM with AnsibleInstalling AtoM with Ansible
Installing AtoM with Ansible
 
Mastering Namespaces in PHP
Mastering Namespaces in PHPMastering Namespaces in PHP
Mastering Namespaces in PHP
 
Puppetizing Your Organization
Puppetizing Your OrganizationPuppetizing Your Organization
Puppetizing Your Organization
 
2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slides2 introduction-php-mvc-cakephp-m2-installation-slides
2 introduction-php-mvc-cakephp-m2-installation-slides
 
PhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 PluginPhpStorm: Symfony2 Plugin
PhpStorm: Symfony2 Plugin
 
PloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyondPloneNG: What's new in Plone 4.2, 4.3, and beyond
PloneNG: What's new in Plone 4.2, 4.3, and beyond
 
Composer
ComposerComposer
Composer
 
CakePHP
CakePHPCakePHP
CakePHP
 
Flask Introduction - Python Meetup
Flask Introduction - Python MeetupFlask Introduction - Python Meetup
Flask Introduction - Python Meetup
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Creating a Plug-In Architecture
Creating a Plug-In ArchitectureCreating a Plug-In Architecture
Creating a Plug-In Architecture
 
PHPUnit with CakePHP and Yii
PHPUnit with CakePHP and YiiPHPUnit with CakePHP and Yii
PHPUnit with CakePHP and Yii
 
Simplify writing code with deliberate commits
Simplify writing code with deliberate commitsSimplify writing code with deliberate commits
Simplify writing code with deliberate commits
 

Similaire à Introduction to makefile

HIT3328 - Chapter0701 - Dialogs, Tabs and Lists
HIT3328 - Chapter0701 - Dialogs, Tabs and ListsHIT3328 - Chapter0701 - Dialogs, Tabs and Lists
HIT3328 - Chapter0701 - Dialogs, Tabs and ListsYhal Htet Aung
 
How to implement ruby on rails testing practices to build a successful web ap...
How to implement ruby on rails testing practices to build a successful web ap...How to implement ruby on rails testing practices to build a successful web ap...
How to implement ruby on rails testing practices to build a successful web ap...Katy Slemon
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHPGautam Rege
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHPAdam Culp
 
The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)Stefan Koopmanschap
 
Refactoring: Code it Clean
Refactoring: Code it CleanRefactoring: Code it Clean
Refactoring: Code it CleanAliGermiyanoglu
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - RefactoringDiaa Al-Salehi
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)Stefan Koopmanschap
 
Software design principles
Software design principlesSoftware design principles
Software design principlesMd.Mojibul Hoque
 
Test Driven Design
Test Driven DesignTest Driven Design
Test Driven DesignSaad Ahmed
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Lemi Orhan Ergin
 
Zend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View EnhancementsZend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View EnhancementsRalph Schindler
 
Beyond Testing: Specs and Behavior Driven Development
Beyond Testing: Specs and Behavior  Driven DevelopmentBeyond Testing: Specs and Behavior  Driven Development
Beyond Testing: Specs and Behavior Driven DevelopmentRabble .
 

Similaire à Introduction to makefile (15)

HIT3328 - Chapter0701 - Dialogs, Tabs and Lists
HIT3328 - Chapter0701 - Dialogs, Tabs and ListsHIT3328 - Chapter0701 - Dialogs, Tabs and Lists
HIT3328 - Chapter0701 - Dialogs, Tabs and Lists
 
How to implement ruby on rails testing practices to build a successful web ap...
How to implement ruby on rails testing practices to build a successful web ap...How to implement ruby on rails testing practices to build a successful web ap...
How to implement ruby on rails testing practices to build a successful web ap...
 
TDD, BDD, RSpec
TDD, BDD, RSpecTDD, BDD, RSpec
TDD, BDD, RSpec
 
Rails Vs CakePHP
Rails Vs CakePHPRails Vs CakePHP
Rails Vs CakePHP
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHP
 
The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)
 
Refactoring: Code it Clean
Refactoring: Code it CleanRefactoring: Code it Clean
Refactoring: Code it Clean
 
Few minutes To better Code - Refactoring
Few minutes To better Code - RefactoringFew minutes To better Code - Refactoring
Few minutes To better Code - Refactoring
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Test Driven Design
Test Driven DesignTest Driven Design
Test Driven Design
 
Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016Test Driven Design - GDG DevFest Istanbul 2016
Test Driven Design - GDG DevFest Istanbul 2016
 
Zend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View EnhancementsZend_Layout & Zend_View Enhancements
Zend_Layout & Zend_View Enhancements
 
Refactoring
RefactoringRefactoring
Refactoring
 
Beyond Testing: Specs and Behavior Driven Development
Beyond Testing: Specs and Behavior  Driven DevelopmentBeyond Testing: Specs and Behavior  Driven Development
Beyond Testing: Specs and Behavior Driven Development
 

Plus de Ray Song

C++ exception handling
C++ exception handlingC++ exception handling
C++ exception handlingRay Song
 
RISC-V Linker Relaxation and LLD
RISC-V Linker Relaxation and LLDRISC-V Linker Relaxation and LLD
RISC-V Linker Relaxation and LLDRay Song
 
gcov和clang中的实现
gcov和clang中的实现gcov和clang中的实现
gcov和clang中的实现Ray Song
 
r2con 2017 r2cLEMENCy
r2con 2017 r2cLEMENCyr2con 2017 r2cLEMENCy
r2con 2017 r2cLEMENCyRay Song
 
Cyber Grand Challenge及DEFCON 24 CTF决赛介绍
Cyber Grand Challenge及DEFCON 24 CTF决赛介绍Cyber Grand Challenge及DEFCON 24 CTF决赛介绍
Cyber Grand Challenge及DEFCON 24 CTF决赛介绍Ray Song
 
OI算法竞赛中树形数据结构
OI算法竞赛中树形数据结构OI算法竞赛中树形数据结构
OI算法竞赛中树形数据结构Ray Song
 
Implementing a Simple Interpreter
Implementing a Simple InterpreterImplementing a Simple Interpreter
Implementing a Simple InterpreterRay Song
 
2011年信息学竞赛冬令营《星际探险》
2011年信息学竞赛冬令营《星际探险》2011年信息学竞赛冬令营《星际探险》
2011年信息学竞赛冬令营《星际探险》Ray Song
 
8门编程语言的设计思考
8门编程语言的设计思考8门编程语言的设计思考
8门编程语言的设计思考Ray Song
 

Plus de Ray Song (9)

C++ exception handling
C++ exception handlingC++ exception handling
C++ exception handling
 
RISC-V Linker Relaxation and LLD
RISC-V Linker Relaxation and LLDRISC-V Linker Relaxation and LLD
RISC-V Linker Relaxation and LLD
 
gcov和clang中的实现
gcov和clang中的实现gcov和clang中的实现
gcov和clang中的实现
 
r2con 2017 r2cLEMENCy
r2con 2017 r2cLEMENCyr2con 2017 r2cLEMENCy
r2con 2017 r2cLEMENCy
 
Cyber Grand Challenge及DEFCON 24 CTF决赛介绍
Cyber Grand Challenge及DEFCON 24 CTF决赛介绍Cyber Grand Challenge及DEFCON 24 CTF决赛介绍
Cyber Grand Challenge及DEFCON 24 CTF决赛介绍
 
OI算法竞赛中树形数据结构
OI算法竞赛中树形数据结构OI算法竞赛中树形数据结构
OI算法竞赛中树形数据结构
 
Implementing a Simple Interpreter
Implementing a Simple InterpreterImplementing a Simple Interpreter
Implementing a Simple Interpreter
 
2011年信息学竞赛冬令营《星际探险》
2011年信息学竞赛冬令营《星际探险》2011年信息学竞赛冬令营《星际探险》
2011年信息学竞赛冬令营《星际探险》
 
8门编程语言的设计思考
8门编程语言的设计思考8门编程语言的设计思考
8门编程语言的设计思考
 

Dernier

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Dernier (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Introduction to makefile

  • 1. Introduction to Makefile Ray Song February 25, 2012 Ray Song Introduction to Makefile
  • 2. Motivation Small programs -> single file -> manual compilation “not so small” programs many files multiple components more than one programmers Ray Song Introduction to Makefile
  • 3. Motivation Small programs -> single file -> manual compilation “not so small” programs many files multiple components more than one programmers Ray Song Introduction to Makefile
  • 4. Motivation Small programs -> single file -> manual compilation “not so small” programs many files multiple components more than one programmers Ray Song Introduction to Makefile
  • 5. Motivation Small programs -> single file -> manual compilation “not so small” programs many files multiple components more than one programmers Ray Song Introduction to Makefile
  • 6. Motivation Small programs -> single file -> manual compilation “not so small” programs many files multiple components more than one programmers Ray Song Introduction to Makefile
  • 7. Motivation - cont. Problems harder to manage every change require long compilation division to components is desired Ray Song Introduction to Makefile
  • 8. Motivation - cont. Problems harder to manage every change require long compilation division to components is desired Ray Song Introduction to Makefile
  • 9. Motivation - cont. Problems harder to manage every change require long compilation division to components is desired Ray Song Introduction to Makefile
  • 10. Motivation - cont. Problems harder to manage every change require long compilation division to components is desired Ray Song Introduction to Makefile
  • 11. Motivation - cont. Solution - Makefile Ray Song Introduction to Makefile
  • 12. Makefile Makefile describes project structure instructions for files creation A makefile consists of many rules. Ray Song Introduction to Makefile
  • 13. Makefile Makefile describes project structure instructions for files creation A makefile consists of many rules. Ray Song Introduction to Makefile
  • 14. Makefile Makefile describes project structure instructions for files creation A makefile consists of many rules. Ray Song Introduction to Makefile
  • 15. Makefile Makefile describes project structure instructions for files creation A makefile consists of many rules. Ray Song Introduction to Makefile
  • 16. Rule syntax TARGETS: PREREQUISITES RECIPE In short, each rule describe instructions (RECIPE) to create files (TARGETS) with PREREQUISITES. PREREQUISITES are targets must be created prior to TARGETS. A target is considered old if its modification timestamp is smaller than one of its dependencies’s. Ray Song Introduction to Makefile
  • 17. Rule syntax TARGETS: PREREQUISITES RECIPE In short, each rule describe instructions (RECIPE) to create files (TARGETS) with PREREQUISITES. PREREQUISITES are targets must be created prior to TARGETS. A target is considered old if its modification timestamp is smaller than one of its dependencies’s. Ray Song Introduction to Makefile
  • 18. Rule syntax TARGETS: PREREQUISITES RECIPE In short, each rule describe instructions (RECIPE) to create files (TARGETS) with PREREQUISITES. PREREQUISITES are targets must be created prior to TARGETS. A target is considered old if its modification timestamp is smaller than one of its dependencies’s. Ray Song Introduction to Makefile
  • 19. Makefile – cont. TARGETS and PREREQUISITES are file names separated by spaces. Usually there is only one target per rule. TARGETS and PREREQUISITES may contain wildcards, e.g. %.c. Each line of RECIPE starts with a TAB. The first rule indicates the default target (not counting targets that contain wildcards). Ray Song Introduction to Makefile
  • 20. Makefile – cont. TARGETS and PREREQUISITES are file names separated by spaces. Usually there is only one target per rule. TARGETS and PREREQUISITES may contain wildcards, e.g. %.c. Each line of RECIPE starts with a TAB. The first rule indicates the default target (not counting targets that contain wildcards). Ray Song Introduction to Makefile
  • 21. Makefile – cont. TARGETS and PREREQUISITES are file names separated by spaces. Usually there is only one target per rule. TARGETS and PREREQUISITES may contain wildcards, e.g. %.c. Each line of RECIPE starts with a TAB. The first rule indicates the default target (not counting targets that contain wildcards). Ray Song Introduction to Makefile
  • 22. Makefile – cont. TARGETS and PREREQUISITES are file names separated by spaces. Usually there is only one target per rule. TARGETS and PREREQUISITES may contain wildcards, e.g. %.c. Each line of RECIPE starts with a TAB. The first rule indicates the default target (not counting targets that contain wildcards). Ray Song Introduction to Makefile
  • 23. Makefile – cont. TARGETS and PREREQUISITES are file names separated by spaces. Usually there is only one target per rule. TARGETS and PREREQUISITES may contain wildcards, e.g. %.c. Each line of RECIPE starts with a TAB. The first rule indicates the default target (not counting targets that contain wildcards). Ray Song Introduction to Makefile
  • 24. make’s mechanism make command reads a makefile and records these rules into its data base. GNU Make defaults to search GNUmakefile, makefile, Makefile in order, use the first of these which exists. The first goal (terminology used to refer to the list of targets you specified on the command line) should be created. Prerequisites which appeared in the target must be processed first. This is a recursive process (depth first search). After updating the dependencies , make decides whether it is necessary to recreated the target. This is the case when it is older than one of its dependencies. In the case we recreate the target, execute the associated recipe. Ray Song Introduction to Makefile
  • 25. make’s mechanism make command reads a makefile and records these rules into its data base. GNU Make defaults to search GNUmakefile, makefile, Makefile in order, use the first of these which exists. The first goal (terminology used to refer to the list of targets you specified on the command line) should be created. Prerequisites which appeared in the target must be processed first. This is a recursive process (depth first search). After updating the dependencies , make decides whether it is necessary to recreated the target. This is the case when it is older than one of its dependencies. In the case we recreate the target, execute the associated recipe. Ray Song Introduction to Makefile
  • 26. make’s mechanism make command reads a makefile and records these rules into its data base. GNU Make defaults to search GNUmakefile, makefile, Makefile in order, use the first of these which exists. The first goal (terminology used to refer to the list of targets you specified on the command line) should be created. Prerequisites which appeared in the target must be processed first. This is a recursive process (depth first search). After updating the dependencies , make decides whether it is necessary to recreated the target. This is the case when it is older than one of its dependencies. In the case we recreate the target, execute the associated recipe. Ray Song Introduction to Makefile
  • 27. make’s mechanism make command reads a makefile and records these rules into its data base. GNU Make defaults to search GNUmakefile, makefile, Makefile in order, use the first of these which exists. The first goal (terminology used to refer to the list of targets you specified on the command line) should be created. Prerequisites which appeared in the target must be processed first. This is a recursive process (depth first search). After updating the dependencies , make decides whether it is necessary to recreated the target. This is the case when it is older than one of its dependencies. In the case we recreate the target, execute the associated recipe. Ray Song Introduction to Makefile
  • 28. make’s mechanism make command reads a makefile and records these rules into its data base. GNU Make defaults to search GNUmakefile, makefile, Makefile in order, use the first of these which exists. The first goal (terminology used to refer to the list of targets you specified on the command line) should be created. Prerequisites which appeared in the target must be processed first. This is a recursive process (depth first search). After updating the dependencies , make decides whether it is necessary to recreated the target. This is the case when it is older than one of its dependencies. In the case we recreate the target, execute the associated recipe. Ray Song Introduction to Makefile
  • 29. make’s mechanism make command reads a makefile and records these rules into its data base. GNU Make defaults to search GNUmakefile, makefile, Makefile in order, use the first of these which exists. The first goal (terminology used to refer to the list of targets you specified on the command line) should be created. Prerequisites which appeared in the target must be processed first. This is a recursive process (depth first search). After updating the dependencies , make decides whether it is necessary to recreated the target. This is the case when it is older than one of its dependencies. In the case we recreate the target, execute the associated recipe. Ray Song Introduction to Makefile
  • 30. make’s mechanism - cont. make virtually construct a dependency DAG (directed acyclic graph). make ensures minimum compilation as long as the project structure is written properly. Do not write something like: prog: main.c sum1.c sum2.c gcc –o prog main.c sum1.c sum2.c which requires compilation of all project when something is changed Ray Song Introduction to Makefile
  • 31. make’s mechanism - cont. make virtually construct a dependency DAG (directed acyclic graph). make ensures minimum compilation as long as the project structure is written properly. Do not write something like: prog: main.c sum1.c sum2.c gcc –o prog main.c sum1.c sum2.c which requires compilation of all project when something is changed Ray Song Introduction to Makefile
  • 32. make’s mechanism - cont. make virtually construct a dependency DAG (directed acyclic graph). make ensures minimum compilation as long as the project structure is written properly. Do not write something like: prog: main.c sum1.c sum2.c gcc –o prog main.c sum1.c sum2.c which requires compilation of all project when something is changed Ray Song Introduction to Makefile
  • 33. make’s mechanism - cont. make virtually construct a dependency DAG (directed acyclic graph). make ensures minimum compilation as long as the project structure is written properly. Do not write something like: prog: main.c sum1.c sum2.c gcc –o prog main.c sum1.c sum2.c which requires compilation of all project when something is changed Ray Song Introduction to Makefile
  • 34. make’s mechanism - cont. make virtually construct a dependency DAG (directed acyclic graph). make ensures minimum compilation as long as the project structure is written properly. Do not write something like: prog: main.c sum1.c sum2.c gcc –o prog main.c sum1.c sum2.c which requires compilation of all project when something is changed Ray Song Introduction to Makefile
  • 35. make’s mechanism - cont. make virtually construct a dependency DAG (directed acyclic graph). make ensures minimum compilation as long as the project structure is written properly. Do not write something like: prog: main.c sum1.c sum2.c gcc –o prog main.c sum1.c sum2.c which requires compilation of all project when something is changed Ray Song Introduction to Makefile
  • 36. Automatic variables $@ $ˆ $< others including $, $?, $+, $|, $%, $(%D), %(F), . . . Ray Song Introduction to Makefile
  • 37. Automatic variables $@ $ˆ $< others including $, $?, $+, $|, $%, $(%D), %(F), . . . Ray Song Introduction to Makefile
  • 38. Automatic variables $@ $ˆ $< others including $, $?, $+, $|, $%, $(%D), %(F), . . . Ray Song Introduction to Makefile
  • 39. Automatic variables $@ $ˆ $< others including $, $?, $+, $|, $%, $(%D), %(F), . . . Ray Song Introduction to Makefile
  • 40. Example convert: cmdline.o convert.o g++ $ˆ -o $@ convert.o: convert.cpp convert.h g++ -c $< cmdline.o: cmdline.cpp cmdline.h convert.h g++ -c $< Ray Song Introduction to Makefile
  • 41. Equivalent (implicit rules) make can dedude appropriate recipes according to suffixes convert: cmdline.o convert.o convert.o: convert.cpp convert.h cmdline.o: cmdline.cpp cmdline.h convert.h Ray Song Introduction to Makefile
  • 42. Equivalent (implicit rules) - cont. convert: cmdline.o convert.o: convert.h cmdline.o: cmdline.h convert.h Ray Song Introduction to Makefile
  • 43. Another example %.o: %.c gcc -c $< Ray Song Introduction to Makefile
  • 44. Passing parameters test: FORCE echo $(VAR) FORCE: make VAR=hello make VAR=world Ray Song Introduction to Makefile
  • 45. Passing parameters test: FORCE echo $(VAR) FORCE: make VAR=hello make VAR=world Ray Song Introduction to Makefile
  • 46. Force targets Targets without recipes or prerequisites Ray Song Introduction to Makefile
  • 47. Phony targets They do not correspond to real file. Provide some utility, e.g. cleaning intermediate files, archiving the whole project, creating TAGS file for some editors Forced to run its recipe upon executing. Ray Song Introduction to Makefile
  • 48. Phony targets They do not correspond to real file. Provide some utility, e.g. cleaning intermediate files, archiving the whole project, creating TAGS file for some editors Forced to run its recipe upon executing. Ray Song Introduction to Makefile
  • 49. Phony targets They do not correspond to real file. Provide some utility, e.g. cleaning intermediate files, archiving the whole project, creating TAGS file for some editors Forced to run its recipe upon executing. Ray Song Introduction to Makefile
  • 50. Example all : prog1 prog2 prog3 .PHONY : all prog1 : prog1.o utils.o cc -o prog1 prog1.o utils.o prog2 : prog2.o cc -o prog2 prog2.o prog3 : prog3.o sort.o utils.o cc -o prog3 prog3.o sort.o utils.o Ray Song Introduction to Makefile
  • 51. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 52. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 53. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 54. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 55. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 56. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 57. Practical options of make -n, print the commands to be run but do not execute them -t, touch files instead of running the recipes -B, unconditionally make all targets (overide timestamps) -W file, pretend file has been just modified -p, print the data base that results from reading the makefiles -d, debug mode others, RTFM Ray Song Introduction to Makefile
  • 58. Other usage Makefile’s mechanism is not limited to programs LaTeX sources website deployment describe any task where some files need updating as a result of changes of other files Ray Song Introduction to Makefile
  • 59. Other usage Makefile’s mechanism is not limited to programs LaTeX sources website deployment describe any task where some files need updating as a result of changes of other files Ray Song Introduction to Makefile
  • 60. Other usage Makefile’s mechanism is not limited to programs LaTeX sources website deployment describe any task where some files need updating as a result of changes of other files Ray Song Introduction to Makefile
  • 61. Other usage Makefile’s mechanism is not limited to programs LaTeX sources website deployment describe any task where some files need updating as a result of changes of other files Ray Song Introduction to Makefile
  • 62. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 63. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 64. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 65. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 66. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 67. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 68. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 69. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 70. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 71. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 72. Additional features Variables (two flavors: simple and recursive, the latter is also called macros) Functions including string substitution, file name manipulation, foreach, even the the root of evil – eval VPATH Ability to manipulate archives(.a) Including other makefiles Conditionals Secondary expansion Order-only prerequisites Static patterns Double-colon rules Target/pattern-specific variable values Ray Song Introduction to Makefile
  • 73. Acknowledgements This slide incorporate some stuff from Roded Sharan’s http://www.cs.tau.ac.il/~roded/courses/softp-b06/ Makefile.ppt Markdown http://daringfireball.net/projects/markdown/ in which this slide source is written. Pandoc http://johnmacfarlane.net/pandoc/ by which this slide is generated. Haskell http://www.haskell.org/ in which Pandoc is implemented. Ray Song Introduction to Makefile
  • 74. Acknowledgements This slide incorporate some stuff from Roded Sharan’s http://www.cs.tau.ac.il/~roded/courses/softp-b06/ Makefile.ppt Markdown http://daringfireball.net/projects/markdown/ in which this slide source is written. Pandoc http://johnmacfarlane.net/pandoc/ by which this slide is generated. Haskell http://www.haskell.org/ in which Pandoc is implemented. Ray Song Introduction to Makefile
  • 75. Acknowledgements This slide incorporate some stuff from Roded Sharan’s http://www.cs.tau.ac.il/~roded/courses/softp-b06/ Makefile.ppt Markdown http://daringfireball.net/projects/markdown/ in which this slide source is written. Pandoc http://johnmacfarlane.net/pandoc/ by which this slide is generated. Haskell http://www.haskell.org/ in which Pandoc is implemented. Ray Song Introduction to Makefile
  • 76. Acknowledgements This slide incorporate some stuff from Roded Sharan’s http://www.cs.tau.ac.il/~roded/courses/softp-b06/ Makefile.ppt Markdown http://daringfireball.net/projects/markdown/ in which this slide source is written. Pandoc http://johnmacfarlane.net/pandoc/ by which this slide is generated. Haskell http://www.haskell.org/ in which Pandoc is implemented. Ray Song Introduction to Makefile
  • 77. References GNU Make Manual http://www.gnu.org/software/make/manual/ Ray Song Introduction to Makefile