Install a program

This assumes you are using Make.gfxtools.rules in your Makefile as described in the Build a program with Make.gfxtools.rules tutorial.
  1. Go to $G/src/projectname
  2. Edit your Makefile
  3. add this line to specify that "make install" should install first the debugging version of the program and then the optimized version. The inst-prog* rules are defined in Make.gfxtools.rules and automatically call gfxinstall3 with the right arguments to copy your executable to $G/bin.
    install: inst-progg inst-progo
    
    include $(G)/lib/Make.gfxtools.rules
    
  4. run "make install" to do the installation.

Getting a bit more complicated: Installing a README file

Let's say you have a README file in your $G/src/projectname directory that you want to install as well. You want it to be installed as $G/doc/README-projectname. Change your install rule in the Makefile to use gfxinstall3 to install the README file. Note, you can run "gfxinstall3 -h" for a help message on its use.
install: inst-progg inst-progo
       gfxinstall3  README  doc/README-projectname

include $(G)/lib/Make.gfxtools.rules
Note all the lines after the one starting with "install:" MUST start with a TAB character!

Installing images, config files, etc..

Resource files that your program depends upon should go inside $G/lib/projectname, following the usual unix conventions. Use the same approach as with the README file above, but with a different target. Also note, in the example below, we don't want to rename the installed file the way we did with the README example above, so the second argument to gfxinstall3 can just be the directory where we want to put the file. BUT, it must end in a slash character if it is supposed to specify a directory. Here's an example that installs one image and one config file in addition to the README file:
install: inst-progg inst-progo
       gfxinstall3  README                doc/README-projectname
       gfxinstall3  default-settings.cfg  lib/$(PROJECT_NAME)/
       gfxinstall3  my-image.jpg          lib/$(PROJECT_NAME)/

include $(G)/lib/Make.gfxtools.rules

Installing config files with the built-in rule

There is also a built-in rule in Make.gfxtools.rules that you could use to install config files, to use it you specify the files to install in the CONFIG makefile variable and then call the rule inst-config. The following example will have the same result as the example above:

CONFIG = default-settings.cfg  my-image.jpg

install: inst-progg inst-progo inst-config
       gfxinstall3  README                doc/README-projectname

include $(G)/lib/Make.gfxtools.rules