<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#f4f4f4>
<DIV><FONT size=2>In many cases makefiles take about just as long to create as
shell scripts or pascal programs - they just offer a nice framework to
automate compiling in an easy way - but in sort of a funny syntax. But
makefiles kind of become ugly when they get big - and because they have a poor
syntax compared to pascal programs - couldn't one just write a pascal program to
automate the compilation process, instead of a makefile? (if a good framework
was in place).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>A reusable "automation" unit or framework would need to
be created so that automating the compile process from within a pascal program
was easy. </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>After thinking about it, I determined that makefiles are
actually PROGRAMS in disguise - not config files, as their syntax seems to lead
us to believe. They are config files on steroids. Config files generally
don't execute instructions.. config files are more geared toward storage of
settings. But makefiles do execute instructions! Makefiles are programs,
not settings files.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>So if makefiles are actually mini-programs, why couldn't we
simply write makefiles in pascal instead of writing makefiles in
makefile-language/fpcmake-language?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Psuedo Example.. let's consider I have to make four CGI
programs in one shot. I want to rename EXE or ELF programs to CGI programs after
the compilation is done. Compiling four programs using Make is possible, writing
up a makefile.. but it could also be done this way:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>program Maker;<BR>uses<BR> CompileTools; //the framework
that simulates MAKE </FONT></DIV>
<DIV><FONT size=2>const</FONT></DIV>
<DIV><FONT size=2> targets : array of [1..4] = ('index.pp',
'main.pp', 'login.pp', 'logout.pp');<BR>begin<BR> // compile several
programs<BR> Compile(targets); <BR> if OStarget = linux
then<BR> writeln('compiling 4 programs for
linux..');<BR> // 4 could actually be "CompileCount", if framework
implemented such a thing</FONT></DIV>
<DIV><FONT size=2> if OStarget = windows then<BR>
writeln('compiling 4 programs for windows..');<BR> for i:= 1 to 4
do</FONT></DIV>
<DIV><FONT size=2> RenameFile(CompiledEXE[i], CompiledEXEName[i] +
'.cgi');<BR> DeleteFiles('*.ppu', '*.a', '*.o');<BR>end;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>At the command line:</FONT></DIV>
<DIV><FONT size=2> maker all</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Instead of using make:</FONT></DIV>
<DIV><FONT size=2> make all</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>The framework in the maker program would handle "all",
"clean", etc.</FONT></DIV>
<DIV><FONT size=2>Instead of writing a new makefile each time we wanted to
automated compilation, we would simple write a new pascal program which used the
maker framework.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Why did I come across this idea? The same reason I sometimes
build a pascal program instead of using a shell script! </FONT></DIV>
<DIV><FONT size=2>The same reason that HTML files would make poor executables!
The same reason that config files are really not meant to be programs... but
rather settings files. Similarly, a config file is really not a program - and
makefiles are becoming INI files on steroids - programs!</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>If compiling the MAKER program each time is too much
work, then maybe this would be a good use for PascalScript.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>So basically my main point is that make files have become
executable INI files - something INI files really aren't intended to be - with
less power and clarity than a real pascal
program.</FONT></DIV></BODY></HTML>