Using GNU Make
Command lines are growing longer and longer, and you will get very tired of typing the commands required to build a programming language. We are already using Unicon, Java, uflex, jflex, iyacc, and BYACC/J. Few tools for building large programs are multi-platform and multi-language enough for this toolset. We will use the ultimate multi-platform, multi-language software build tool: GNU Make.
Once the Make
program is installed on your path, you can store the build rules for Unicon or Java, or both, in a file named a makefile
(or Makefile
), and then just run Make
whenever you have changed the code and need to rebuild. A full treatment of Make is beyond the scope of this book, but here are the key points.
A makefile
is like a lex or yacc specification, except instead of recognizing patterns of strings, a makefile
specifies a graph of build dependencies between files. For each file, the makefile
contains the source files it depends on as well as a list of one or...