Skip to content

Commit 8a4de0d

Browse files
committed
* 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.
1 parent 9a8006b commit 8a4de0d

22 files changed

+59
-126
lines changed

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
* builds/unix/install.mk (install): Fix path for ftmodule.h.
1111

12+
* Makefile, *.mk: Use `?=' where appropriate.
13+
14+
* builds/detect.mk (TOP_DIR), builds/os2/os2-dev.mk (TOP_DIR),
15+
builds/win32/w32-dev.mk (TOP_DIR): Removed. Defined elsewhere.
16+
1217
2006-01-31 Werner Lemberg <[email protected]>
1318

1419
Implement new, simplified module selection. With GNU make it is now

Makefile

+3-7
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,18 @@
1515

1616
# Project names
1717
#
18-
PROJECT := freetype
18+
PROJECT := freetype
1919
PROJECT_TITLE := FreeType
2020

2121
# The variable TOP_DIR holds the path to the topmost directory in the project
2222
# engine source hierarchy. If it is not defined, default it to `.'.
2323
#
24-
ifndef TOP_DIR
25-
TOP_DIR := .
26-
endif
24+
TOP_DIR ?= .
2725

2826
# The variable OBJ_DIR gives the location where object files and the
2927
# FreeType library are built.
3028
#
31-
ifndef OBJ_DIR
32-
OBJ_DIR := $(TOP_DIR)/objs
33-
endif
29+
OBJ_DIR ?= $(TOP_DIR)/objs
3430

3531

3632
include $(TOP_DIR)/builds/toplevel.mk

builds/ansi/ansi-def.mk

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ T := -o$(space)
6363
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6464
# ANSI compliance.
6565
#
66-
ifndef CFLAGS
67-
CFLAGS := -c
68-
endif
66+
CFLAGS ?= -c
6967

7068
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7169
#

builds/beos/beos-def.mk

+1-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ T := -o$(space)
6565
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6666
# ANSI compliance.
6767
#
68-
ifndef CFLAGS
69-
CFLAGS := -c
70-
endif
68+
CFLAGS ?= -c
7169

7270
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7371
#

builds/compiler/ansi-cc.mk

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@ T := -o$(space)
6262
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6363
# ANSI compliance.
6464
#
65-
ifndef CFLAGS
66-
CFLAGS := -c
67-
endif
65+
CFLAGS ?= -c
6866

6967
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7068
#
@@ -75,10 +73,8 @@ ANSIFLAGS :=
7573

7674
# Library linking
7775
#
78-
ifndef CLEAN_LIBRARY
79-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
80-
endif
81-
LINK_LIBRARY = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST))
76+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
77+
LINK_LIBRARY = $(AR) -r $@ $(subst /,$(COMPILER_SEP),$(OBJECTS_LIST))
8278

8379

8480
# EOF

builds/compiler/bcc-dev.mk

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@ T := -o
6262
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6363
# ANSI compliance.
6464
#
65-
ifndef CFLAGS
66-
CFLAGS := -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
67-
endif
65+
CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
6866

6967
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7068
#
@@ -73,10 +71,8 @@ ANSIFLAGS := -A
7371

7472
# Library linking
7573
#
76-
ifndef CLEAN_LIBRARY
77-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
78-
endif
79-
LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
74+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
75+
LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
8076

8177

8278
# EOF

builds/compiler/bcc.mk

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -62,9 +62,7 @@ T := -o
6262
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6363
# ANSI compliance.
6464
#
65-
ifndef CFLAGS
66-
CFLAGS := -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
67-
endif
65+
CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
6866

6967
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7068
#
@@ -73,10 +71,8 @@ ANSIFLAGS := -A
7371

7472
# Library linking
7573
#
76-
ifndef CLEAN_LIBRARY
77-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
78-
endif
79-
LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
74+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
75+
LINK_LIBRARY = tlib /u $(subst /,$(COMPILER_SEP),$@ $(OBJECTS_LIST:%=+%))
8076

8177

8278
# EOF

builds/compiler/emx.mk

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 2003 by
6+
# Copyright 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -61,9 +61,7 @@ T := -o$(space)
6161
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6262
# ANSI compliance.
6363
#
64-
ifndef CFLAGS
65-
CFLAGS := -c -g -O6 -Wall
66-
endif
64+
CFLAGS ?= -c -g -O6 -Wall
6765

6866
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
6967
#
@@ -72,10 +70,8 @@ ANSIFLAGS :=
7270

7371
# Library linking
7472
#
75-
ifndef CLEAN_LIBRARY
76-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
77-
endif
78-
LINK_LIBRARY = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul
73+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
74+
LINK_LIBRARY = $(foreach m,$(OBJECTS_LIST),$(AR) -r $@ $(m);) echo > nul
7975

8076

8177
# EOF

builds/compiler/gcc-dev.mk

+3-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003, 2004, 2005 by
6+
# Copyright 1996-2000, 2003, 2004, 2005, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -87,10 +87,8 @@ ANSIFLAGS := -ansi -pedantic
8787

8888
# Library linking
8989
#
90-
ifndef CLEAN_LIBRARY
91-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
92-
endif
93-
LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
90+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
91+
LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
9492

9593

9694
# EOF

builds/compiler/gcc.mk

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003, 2005 by
6+
# Copyright 1996-2000, 2003, 2005, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -61,9 +61,7 @@ T := -o$(space)
6161
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6262
# ANSI compliance.
6363
#
64-
ifndef CFLAGS
65-
CFLAGS := -c -g -O6 -Wall
66-
endif
64+
CFLAGS ?= -c -g -O6 -Wall
6765

6866
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
6967
#
@@ -72,10 +70,8 @@ ANSIFLAGS := -ansi -pedantic
7270

7371
# Library linking
7472
#
75-
ifndef CLEAN_LIBRARY
76-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
77-
endif
78-
LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
73+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
74+
LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
7975

8076

8177
# EOF

builds/compiler/intelc.mk

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -69,9 +69,7 @@ T := /Fo
6969
# _does_ compute an arithmetic value, so we disable this warning
7070
# with "/Qwd32".
7171
#
72-
ifndef CFLAGS
73-
CFLAGS := /nologo /c /Ox /G5 /W3 /Qwd32
74-
endif
72+
CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
7573

7674
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7775
#

builds/compiler/unix-lcc.mk

+4-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@ T := -o$(space)
6363
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6464
# ANSI compliance.
6565
#
66-
ifndef CFLAGS
67-
CFLAGS := -c -g
68-
endif
66+
CFLAGS ?= -c -g
6967

7068
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7169
#
@@ -78,10 +76,8 @@ ANSIFLAGS := -A
7876

7977
# library linking
8078
#
81-
ifndef CLEAN_LIBRARY
82-
CLEAN_LIBRARY = $(DELETE) $(PROJECT_LIBRARY)
83-
endif
84-
LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
79+
CLEAN_LIBRARY ?= $(DELETE) $(PROJECT_LIBRARY)
80+
LINK_LIBRARY = $(AR) -r $@ $(OBJECTS_LIST)
8581

8682

8783
# EOF

builds/compiler/visualage.mk

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -60,9 +60,7 @@ T := /Fo
6060
#
6161
# These should concern: debug output, optimization & warnings.
6262
#
63-
ifndef CFLAGS
64-
CFLAGS := /Q- /Gd+ /O2 /G5 /W3 /C
65-
endif
63+
CFLAGS ?= /Q- /Gd+ /O2 /G5 /W3 /C
6664

6765
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
6866
#

builds/compiler/visualc.mk

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003, 2005 by
6+
# Copyright 1996-2000, 2003, 2005, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -66,9 +66,7 @@ TE := /Fe
6666
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6767
# ANSI compliance.
6868
#
69-
ifndef CFLAGS
70-
CFLAGS := /nologo /c /Ox /G5 /W3 /WX
71-
endif
69+
CFLAGS ?= /nologo /c /Ox /G5 /W3 /WX
7270

7371
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7472
#

builds/compiler/watcom.mk

+7-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@ T := -FO=
6363
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6464
# ANSI compliance.
6565
#
66-
ifndef CFLAGS
67-
CFLAGS := -zq
68-
endif
66+
CFLAGS ?= -zq
6967

7068
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7169
#
@@ -74,12 +72,10 @@ ANSIFLAGS := -za
7472

7573
# Library linking
7674
#
77-
ifndef CLEAN_LIBRARY
78-
CLEAN_LIBRARY = $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
79-
endif
80-
LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \
81-
wlib -q -n $@; \
82-
$(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
83-
echo > nul)
75+
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
76+
LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \
77+
wlib -q -n $@; \
78+
$(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
79+
echo > nul)
8480

8581
# EOF

builds/compiler/win-lcc.mk

+2-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44

55

6-
# Copyright 1996-2000, 2003 by
6+
# Copyright 1996-2000, 2003, 2006 by
77
# David Turner, Robert Wilhelm, and Werner Lemberg.
88
#
99
# This file is part of the FreeType project, and may only be used, modified,
@@ -63,9 +63,7 @@ T := -Fo
6363
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
6464
# ANSI compliance.
6565
#
66-
ifndef CFLAGS
67-
CFLAGS := -c -g2 -O
68-
endif
66+
CFLAGS ?= -c -g2 -O
6967

7068
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
7169
#

0 commit comments

Comments
 (0)