bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cleaning up Make syntax


From: Mcguinness, Brian B
Subject: Cleaning up Make syntax
Date: Thu, 31 Mar 2005 16:31:10 -0500

Some people complain that make doesn't have enough flexibility to suit their
needs.  My main complaint about it is that it requires a tab at the beginning
of the lines that contain commands; if you type a space instead, the makefile
doesn't work.  You can't see this error by looking at the file.  This is
abysmally stupid; make should accept any whitespace at the beginning of the
line, not just tabs.  Recent versions of make seem to kludge in additional
functionality, trying to somehow fit it in to the existing makefile syntax,
e.g.  phony targets specified with ".PHONY" in GNU make.

Ant is sometimes lauded as a superior alternative, but it has also been
criticized as being even more primitive than make, being too Java-oriented,
and having a clumsy XML syntax.  I have not used it much, but I don't see any
strong advantages over make.

When I look at a dependency line and its associated command lines in a
makefile, they remind me of a function definition, with the target name in
place of the function name, the dependencies in place of arguments, and the
commands in place of the function body.  This suggests that one approach to
creating a better build tool might be to create a true programming language
for defining builds, supporting dependency block structures something like

target 
  my_module.o
dependencies
  my_module.c my_module.h
begin
  shell "cc -c " target[0] " " dependency[0];
end

as well as the control structures and function definition features found in
most programming languages.  This would provide automated dependency
resolution combined with standard programming language capabilities.  That
should be flexible enough to handle pretty much any imaginable build task,
while having a clean syntax not dependent on beginning-of-line whitespace,
phony targets, or other such nonsense.

--- Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]