freetype
[Top][All Lists]
Advanced

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

Re: Gnu Make Specifics


From: David Turner
Subject: Re: Gnu Make Specifics
Date: Fri, 25 Feb 2000 12:36:47 +0100

Hi Saptal,

Satpal Chander a écrit :
> 
> Hi,
>    could anyone tell me what the the makefile in freetype2 relies on
> within gnu make to make it function.
>
Actually, it relies on lots of things that are easier completely
unavailable with other Make tools, or use a very different syntax.
Briefly, the list goes as:

  - sub-Makefile inclusion (widely available)

  - direct evaluation through ":=" instead of "=". This
    is extremely important. (a bit less widely available)

  - pattern matching is also heavily used in many rules,
    e.g.  $(VAR:$(SRC_DIR)%.c=$(OBJ_DIR)%.$O)

  - wildcarding : $(wildcard src/*/rules.mk) lists all files named
    "rules.mk" in subdirectories of "src"

  - shell execution : $(shell ver) returns a string containing what
    the "ver" command outputs. $(shell uname) on unix systems..

  - accessing the make command line targets through $(MAKECMDGOALS)


Most, if not all, of these "advanced" features are required to implement
the current features of the build system. Namely :

  - automatic host-detection including Unix, Dos, Windows and OS/2 for now.
    (and a Automake/Autoconf can be inserted later for Unix, for those who 
care).

  - platform-specific configuration selection, as in "make setup visualc"
    which selects a "config.mk" for Visual C++ on Win32 machines.

  - rebuilding the list of statically linked modules through "make modules"
    (regenerates the file "config/<system>/ftmodule.h" included by
    "src/base/ftinit.c"

  - automatically compiling all the modules located in the "src" directory
    by finding a "rules.mk" find in each sub-directory which contains the
    rules specific to that module. This allows adding or removing a module
    as easily as moving a directory.

A lot of these things have been chosen to allow for a very dynamic build system.
For example, to add a new supported platform, all you need to provide is a
"config/<system>" directory with relevant files (no need to tweak other
Makefiles).

Another example : to add a new fot driver, simply add a new directory to
"freetype2/src/" containing a "rules.mk" and a "module.mk" (plus all
source files), then run "make modules" to rebuild the list of modules
automatically.

> If I use anything else I get
> a missing seperator error on line 34 of the makefile(both Unix(Irix)& WinNt)
> I can get around make file but don;t know the in's and out's of them.
> 
I really advise you to install gnu make on your system. It's the only
recommended way to compile FreeType 2 on the command line for now.

The final release of FreeType 2 will most probably include a Makefile target
to be used to copy all required source files to a single directory, which will
allow direct compilation. (like invoking "gnu-make flat-compile" to copy all
relevant source files to a single direcroy and create one big standard
Makefile for them). For now, I'll stick to the current way of doing things
because it is much more dynamic and eases many things during development.

Cheers,

- David


> Cheers
> Satpal



reply via email to

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