Où sommes nous ?

Retour

LFMakeMaker home page

An old program I wrote in the 90's that generates for you Makefiles from your C or C++ sources. This page is only a copy/past of the documentation present in source code's header.

It exists more recent (and probably more powerful) tools, but LFMakeMaker continues to suite my needs and does its job great.

Preamble

I wrote this little code for automaticaly creating MakeFile for GCC (but may be used with others compilers).
It was developped on the Amiga in a portable way. No Amiga specific function is used... see ports notes.

How to use it

    LFMakeMaker [option] source_files

Invoque 'LFMakeMaker' without any argument to get the list of available options.

LFMakeMaker 1.1 (Mar 27 2011 14:06:24)
(c) LFSoft 1997.

LFMakeMaker [options] sources_file
options are:
options for local headers (#include "xxx")
+l or --local : Looks for local headers (default)
-l or --no-local : Doesn't look for local headers
+lr or --recurse-local : Looks recursively into local headers (default)
-lr or --no-recurse-local : Doesn't look recursively into local headers

options for global headers (#include <xxx>)
+g or --global : Looks for global headers
-g or --no-global : Doesn't look for global headers (default)
+gr or --recurse-global : Looks recursively into global headers
-gr or --no-recurse-global : Doesn't look recursively into global headers (default)

Target's options:
-e="filename" or --exec="filename" : Generate executable file
-o or --object : Generate objects file (default)
-t{="filename"} or --target{="filename"} : Links all objects files to the given
executable. If no "filename" is given, all precedent objects are
only forgotten.
-so="filename" or --shared="filename" : Links all objects files to the given shared object.
-po{="xxxx"} or --prefix{="xxxx"} : Specify a prefix for object files.

misceanlous options:
+c="filename" or --check="filename" : Add "filename" to dependancies lists
if present in source file (overwrite '--no-local' and '--no-global')
-c="filename" or --no-check="filename" : Remove "filename" from the list of
files to checks.
+f="filename" or --force="filename" : Unconditionnaly add "filename" to
dependancies lists.
-f="filename" or --no-force="filename" : Remove "filename" form the list of
files to forces.
+i="filename" or --ignore="filename" : Always ignore "filename".
-i="filename" or --no-ignore="filename" : Remove "filename" from the list
of files to ignore.
-I"directory" : Add "directory" to the list of include directories.
Notes: Don't forget trailing separator ('/' on UNIX and AmigaDOS).
Searches are made in reverse order (last -I searched first).
+cs or --case-sensitif : Be case sensitive.
-cs or --no-case-sensitif : Be case insensitive.
+nc or --nested : Allow nested comments (default).
-nc or --no-nested : Forbid nested comments.
The default is accorded with your architecture file-system
(-cs on the Amiga or +cs on Unix).
-cc="cmd" or --compiler="cmd" : Use 'cmd' as compiler command,
default is 'cc'.
--line="number" : Set the limite of a line length in generated makefile.
--tab="number": Set the number of space for a TAB.
--fatal : Abort if an include file can't be opened
or when a target is generated twice.
--no-fatal : Warn if an include file can't be opened (default).
-v or --verbose : Display all processed file.
--debug : Display currently active options.

Never forget that a source is affected only by options before it.
E.g.:

LFMakeMaker file1.c +c=truc.h file2.c -c=truc.h file3.c

'truc.h' is only checked in file2.c.

Some examples can be found in the header of the source code.

Before reading arguments, LFMakeMaker looks for "LFMakeMaker" environnemental variable that may contains always used options. Its best use is to define path to your include directories tree (-I option).
Look at your compiler's documentation about where includes are located. Some compilers like Gcc may display all include directories at run time but adding '-v' argument (or --verbose) to the command line.

This is an example of LFMakeMaker variable content i use with GCC 2.7.0 on my Amigas:

  setenv LFMakeMaker "-I/gnu/lib/gcc-lib/m68k-cbm-amigados/2.7.0/g++-include/
    -I/gnu/lib/g++-include/ -I/gnu/local/include/
    -I/gnu/m68k-cbm-amigados/include/
    -I/gnu/lib/gcc-lib/m68k-cbm-amigados/2.7.0/include/ -I/gnu/os-include/
    -I/gnu/include/"

Notes

      ..
#ifdef DEBUG
    if(ok && test){ // }
#else
     if(ok){
#endif

Notez-bien : One of the opening '{' is paired by a commented-out '}'. The second is paired (as usual) at the block-ending.

 

Ports notes

Compilation

Gcc 2.7.0 produces no warnings when compiling with -Wall (all warning enabled). On all systems, following options may be added:

On the Amiga, you may add following options to GCC :

 

Copyright

Even this tool is FREEWARE, gifts are welcome ( 68060 board, Multi-Sync monitor (ha ha), chocolates, ... or only a post card ). Drop me a mail using the link at the bottom of this page.

LFMakeMaker was developped and tested on

All under GCC 2.7.0 from Amiga's CD-ROM Fresh Fish 10.
Some part of this source code was inspired by my very own LFLocalize 0.5ß.

MungWall & Enforcer are CopyRighted Commodore - Amiga.

2011 update

After this document writing, LFMakeMaker has been also used successfully on :

Know bugs

Until now, following bugs had been found in the Amiga version of LFMakeMaker, may not appli to others architectures...

History

Version 1.0

Version 1.1

Version 1.2

Version 1.3

Aminet orginial files :

Updated source code :


Visitez :
La liste de nos voyages
Nos sorties Ski et rando
Copyright Laurent Faillie 2001-2024
N'oubliez pas d'entrer le mot de passe pour voir aussi les photos perso.
Contactez moi si vous souhaitez réutiliser ces photos et pour les obtenir avec une plus grande résolution.
Visites durant les 7 derniers jours Nombre de visites au total.

Vous pouvez laissez un commentaire sur cette page.