ref: 8a4de0d66947e8aca820025b62446d400d25280f
parent: 9a8006b18ee2a8bdd2889d6f0dd932d197060827
author: Werner Lemberg <[email protected]>
date: Wed Feb 1 02:52:11 EST 2006
* Makefile, *.mk: Use `?=' where appropriate. * builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR), builds/win32/w32-dev.mk (TOP_DIR): Removed. Defined elsewhere.
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,11 @@
* builds/unix/install.mk (install): Fix path for ftmodule.h.
+ * Makefile, *.mk: Use `?=' where appropriate.
+
+ * builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR),
+ builds/win32/w32-dev.mk (TOP_DIR): Removed. Defined elsewhere.
+
2006-01-31 Werner Lemberg <[email protected]>
Implement new, simplified module selection. With GNU make it is now
--- a/Makefile
+++ b/Makefile
@@ -15,22 +15,18 @@
# Project names
#
-PROJECT := freetype
+PROJECT := freetype
PROJECT_TITLE := FreeType
# The variable TOP_DIR holds the path to the topmost directory in the project
# engine source hierarchy. If it is not defined, default it to `.'.
#
-ifndef TOP_DIR
- TOP_DIR := .
-endif
+TOP_DIR ?= .
# The variable OBJ_DIR gives the location where object files and the
# FreeType library are built.
#
-ifndef OBJ_DIR
- OBJ_DIR := $(TOP_DIR)/objs
-endif
+OBJ_DIR ?= $(TOP_DIR)/objs
include $(TOP_DIR)/builds/toplevel.mk
--- a/builds/ansi/ansi-def.mk
+++ b/builds/ansi/ansi-def.mk
@@ -63,9 +63,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c
-endif
+CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
--- a/builds/beos/beos-def.mk
+++ b/builds/beos/beos-def.mk
@@ -65,9 +65,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c
-endif
+CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
--- a/builds/compiler/ansi-cc.mk
+++ b/builds/compiler/ansi-cc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c
-endif
+CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -75,10 +73,8 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST))
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST))
# EOF
--- a/builds/compiler/bcc-dev.mk
+++ b/builds/compiler/bcc-dev.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
-endif
+CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -73,10 +71,8 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
# EOF
--- a/builds/compiler/bcc.mk
+++ b/builds/compiler/bcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
-endif
+CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -73,10 +71,8 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
# EOF
--- a/builds/compiler/emx.mk
+++ b/builds/compiler/emx.mk
@@ -3,7 +3,7 @@
#
-# Copyright 2003 by
+# Copyright 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -61,9 +61,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c -g -O6 -Wall
-endif
+CFLAGS ?= -c -g -O6 -Wall
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -72,10 +70,8 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul
# EOF
--- a/builds/compiler/gcc-dev.mk
+++ b/builds/compiler/gcc-dev.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003, 2004, 2005 by
+# Copyright 1996-2000, 2003, 2004, 2005, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -87,10 +87,8 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
# EOF
--- a/builds/compiler/gcc.mk
+++ b/builds/compiler/gcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-2000, 2003, 2005, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -61,9 +61,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c -g -O6 -Wall
-endif
+CFLAGS ?= -c -g -O6 -Wall
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -72,10 +70,8 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
# EOF
--- a/builds/compiler/intelc.mk
+++ b/builds/compiler/intelc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -69,9 +69,7 @@
# _does_ compute an arithmetic value, so we disable this warning
# with "/Qwd32".
#
-ifndef CFLAGS
- CFLAGS := /nologo /c /Ox /G5 /W3 /Qwd32
-endif
+CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
--- a/builds/compiler/unix-lcc.mk
+++ b/builds/compiler/unix-lcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c -g
-endif
+CFLAGS ?= -c -g
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -78,10 +76,8 @@
# library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(PROJECT_LIBRARY)
-endif
-LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
+CLEAN_LIBRARY ?= $(DELETE) $(PROJECT_LIBRARY)
+LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
# EOF
--- a/builds/compiler/visualage.mk
+++ b/builds/compiler/visualage.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -60,9 +60,7 @@
#
# These should concern: debug output, optimization & warnings.
#
-ifndef CFLAGS
- CFLAGS := /Q- /Gd+ /O2 /G5 /W3 /C
-endif
+CFLAGS ?= /Q- /Gd+ /O2 /G5 /W3 /C
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
--- a/builds/compiler/visualc.mk
+++ b/builds/compiler/visualc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003, 2005 by
+# Copyright 1996-2000, 2003, 2005, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -66,9 +66,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := /nologo /c /Ox /G5 /W3 /WX
-endif
+CFLAGS ?= /nologo /c /Ox /G5 /W3 /WX
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
--- a/builds/compiler/watcom.mk
+++ b/builds/compiler/watcom.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -zq
-endif
+CFLAGS ?= -zq
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
@@ -74,12 +72,10 @@
# Library linking
#
-ifndef CLEAN_LIBRARY
- CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
-endif
-LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \
- wlib -q -n $@; \
- $(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
- echo > nul)
+CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
+LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \
+ wlib -q -n $@; \
+ $(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
+ echo > nul)
# EOF
--- a/builds/compiler/win-lcc.mk
+++ b/builds/compiler/win-lcc.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003 by
+# Copyright 1996-2000, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
-ifndef CFLAGS
- CFLAGS := -c -g2 -O
-endif
+CFLAGS ?= -c -g2 -O
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
--- a/builds/detect.mk
+++ b/builds/detect.mk
@@ -38,12 +38,6 @@
# TOP_DIR The top-most directory in the FreeType library source
# hierarchy. If not defined, it will default to `.'.
-# If TOP_DIR is not defined, default it to `.'
-#
-ifndef TOP_DIR
- TOP_DIR := .
-endif
-
# Set auto-detection default to `ansi' resp. UNIX-like operating systems.
#
PLATFORM := ansi
--- a/builds/dos/detect.mk
+++ b/builds/dos/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2003, 2004 by
+# Copyright 1996-2000, 2003, 2004, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -73,9 +73,7 @@
# Use DJGPP (i.e. gcc) by default.
#
CONFIG_FILE := dos-gcc.mk
- ifndef CC
- CC := gcc
- endif
+ CC ?= gcc
# additionally, we provide hooks for various other compilers
#
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -105,9 +105,7 @@
# The documentation directory.
#
-ifndef DOC_DIR
- DOC_DIR := $(TOP_DIR)/docs/reference
-endif
+DOC_DIR ?= $(TOP_DIR)/docs/reference
# The final name of the library file.
#
@@ -192,9 +190,7 @@
# ftsystem component
#
-ifndef FTSYS_SRC
- FTSYS_SRC := $(BASE_DIR)/ftsystem.c
-endif
+FTSYS_SRC ?= $(BASE_DIR)/ftsystem.c
FTSYS_OBJ := $(OBJ_DIR)/ftsystem.$O
@@ -206,9 +202,7 @@
# ftdebug component
#
-ifndef FTDEBUG_SRC
- FTDEBUG_SRC := $(BASE_DIR)/ftdebug.c
-endif
+FTDEBUG_SRC ?= $(BASE_DIR)/ftdebug.c
FTDEBUG_OBJ := $(OBJ_DIR)/ftdebug.$O
--- a/builds/os2/os2-dev.mk
+++ b/builds/os2/os2-dev.mk
@@ -15,10 +15,6 @@
# fully.
-ifndef TOP_DIR
- TOP_DIR := .
-endif
-
DEVEL_DIR := $(TOP_DIR)/devel
# include OS/2-specific definitions
--- a/builds/toplevel.mk
+++ b/builds/toplevel.mk
@@ -58,9 +58,7 @@
# FTMODULE_H, as its name suggests, indicates where the FreeType module
# classes resides.
#
-ifndef FTMODULE_H
- FTMODULE_H := $(OBJ_DIR)/ftmodule.h
-endif
+FTMODULE_H ?= $(OBJ_DIR)/ftmodule.h
include $(MODULES_CFG)
@@ -74,9 +72,7 @@
$(AUX_MODULES)
-ifndef CONFIG_MK
- CONFIG_MK := config.mk
-endif
+CONFIG_MK ?= config.mk
# If no configuration sub-makefile is present, or if `setup' is the target
# to be built, run the auto-detection rules to figure out which
--- a/builds/win32/w32-dev.mk
+++ b/builds/win32/w32-dev.mk
@@ -19,10 +19,6 @@
# Shell (_not_ Cygwin BASH)!
#
-ifndef TOP_DIR
- TOP_DIR := .
-endif
-
DEVEL_DIR := $(TOP_DIR)/devel
include $(TOP_DIR)/builds/win32/win32-def.mk