nmakegen - Dependency and Makefile generator for nML

Sukyoung Ryu
ROPAS
Dept. of Computer Science
KAIST (Korea Advanced Institute of Science and Technology)

Courtesy

Generation of .depend files, which is one of the features of nmakegen, is based on Objective Caml' ocamldep.

Synopsis

nmakegen [ -I lib-dir ] [ -r lib-dir ] [ -l linkflags ] [ -f ] [ -d ] [ -cc camlc ] [ -co camlopt ] [ -nc nmlc ] [ -nm nmakegen ] [ -lex nlex ] [ -yacc nyacc ] [ -yf yaccflags ] [ object ]

Description

The nmakegen command does following three things: (1) it collects a set of nML source files (.n, .nl, .ny files) and Objective Caml source files (.ml, .mli files) and outputs their names in .nfiles, (2) scans the files in .nfiles for references to external compilation units and outputs dependency lines in .depend, and (3) outputs Makefile in a format suitable for the make(1) utility. The .depend file ensures that make(1) will compile the source files in the correct order, and recompile those files that need to when a source file is modified.

When there is a lex file foo.nl in the list of directories searched for source files, nmakegen generates a foo.n file from the foo.nl file by nlex and outputs a message of "Warning: nmakegen made foo.n". When there is a yacc file foo.ny in the list of directories searched for source files, nmakegen generates a foo.n file from the foo.ny file by nyacc and outputs a message of "Warning: nmakegen made foo.n". When there is any problem with parsing an nML source file foo.n, nmakegen outputs a message of "Warning: nmakegen fails to deal with foo.n", ignores the file foo.n, and then proceeds. When there are mutually recursive files a.n and b.n in the list of directories searched for source files, nmakegen terminates abnormally and outputs a message of "Error: a.n and b.n are mutually recursive." Finally, when there already exists either .nfiles, .depend, or Makefile in the current working directory, nmakegen does not overwrite the existing file. Instead, nmakegen generates .nfiles.1, .depend.1, or Makefile.1. When there already exists .nfiles.i, .depend.j, or Makefile.k in the directory, nmakegen generates .nfiles.i+1, .depend.j+1, or Makefile.k+1, respectively.

Options

The following command-line options are recognized by nmakegen.

-I directory

    Add the given directory to the list of directories searched for source files. If a source file foo.n mentions an external compilation unit Bar, a dependency on that unit's interface bar.cmi is generated only if the source for bar is found in the current directory or in one of the directories specified with -I. Otherwise, Bar is assumed to be a module from the standard library, and no dependencies are generated. For programs that span multiple directories, it is recommended to pass nmakegen the same -I options that are passed to the compiler.

-r directory

    Same as -I, except that the given directory is searched recursively.

-l linkflags

    Use the given linkflags in Makefile.

-f

    Generate only .nfiles.

-d

    Generate only .nfiles and .depend.

-cc camlc

    Use the given camlc to compile Objective Caml source files in Makefile.

-co camlopt

    Use the given camlopt to compile Objective Caml source files in Makefile.

-nc nmlc

    Use the given nmlc to compile nML source files in Makefile.

-nm nmakegen

    Use the given nmakegen in Makefile.

-lex nlex

    Use the given nlex to generate .n files from .nl files.

-yacc nyacc

    Use the given nyacc to generate .n files from .ny files.

-yf yaccflags

    Use the given yaccflags for nyacc.

Restrictions

Download

nmakegen.tar.gz