* builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat' or `type'. * builds/freetype.mk (version): Extracted from freetype.h, using GNU make's built-in string functions. (refdoc): Use $(version) instead of static version number.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
diff --git a/ChangeLog b/ChangeLog
index bc589d9..dd84b19 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-12-09 Werner Lemberg <wl@gnu.org>
+
+ * builds/*/*def.mk, builds/*/detect.mk (CAT): Define to either `cat'
+ or `type'.
+
+ * builds/freetype.mk (version): Extracted from freetype.h, using
+ GNU make's built-in string functions.
+ (refdoc): Use $(version) instead of static version number.
+
2006-12-08 Werner Lemberg <wl@gnu.org>
* builds/toplevel.mk (dist): Extract version number from freetype.h.
diff --git a/builds/ansi/ansi-def.mk b/builds/ansi/ansi-def.mk
index 6b8ecfa..2c58572 100644
--- a/builds/ansi/ansi-def.mk
+++ b/builds/ansi/ansi-def.mk
@@ -14,6 +14,7 @@
DELETE := rm -f
+CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/ansi
PLATFORM := ansi
diff --git a/builds/beos/beos-def.mk b/builds/beos/beos-def.mk
index 7e79d04..4371a30 100644
--- a/builds/beos/beos-def.mk
+++ b/builds/beos/beos-def.mk
@@ -16,6 +16,7 @@
DELETE := rm -f
+CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/beos
PLATFORM := beos
diff --git a/builds/beos/detect.mk b/builds/beos/detect.mk
index 8333aba..24a0878 100644
--- a/builds/beos/detect.mk
+++ b/builds/beos/detect.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,
@@ -28,6 +28,7 @@ endif
ifeq ($(PLATFORM),beos)
DELETE := rm -f
+ CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/beos
CONFIG_FILE := beos.mk
diff --git a/builds/detect.mk b/builds/detect.mk
index 6d85f0c..c3632c0 100644
--- a/builds/detect.mk
+++ b/builds/detect.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000, 2001, 2002, 2003 by
+# Copyright 1996-2000, 2001, 2002, 2003, 2006 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -43,6 +43,7 @@
PLATFORM := ansi
DELETE := $(RM)
COPY := cp
+CAT := cat
SEP := /
BUILD_CONFIG := $(TOP_DIR)/builds
diff --git a/builds/dos/detect.mk b/builds/dos/detect.mk
index cabc6d6..700a122 100644
--- a/builds/dos/detect.mk
+++ b/builds/dos/detect.mk
@@ -116,10 +116,12 @@ ifeq ($(PLATFORM),dos)
SEP := /
DELETE := rm
COPY := cp
+ CAT := cat
setup: std_setup
else
SEP := $(BACKSLASH)
DELETE := del
+ CAT := type
# Setting COPY is a bit trickier. We can be running DJGPP on some
# Windows NT derivatives, like XP. See builds/win32/detect.mk for
diff --git a/builds/dos/dos-def.mk b/builds/dos/dos-def.mk
index c68bd74..950f581 100644
--- a/builds/dos/dos-def.mk
+++ b/builds/dos/dos-def.mk
@@ -14,6 +14,7 @@
DELETE := del
+CAT := type
SEP := $(strip \ )
BUILD_DIR := $(TOP_DIR)/builds/dos
PLATFORM := dos
diff --git a/builds/freetype.mk b/builds/freetype.mk
index 2afd8c8..9d9c233 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -267,6 +267,29 @@ dll: $(PROJECT_LIBRARY) exported_symbols
$(FT_COMPILE) $T$(subst /,$(COMPILER_SEP),$@ $<)
+ifneq ($(findstring refdoc,$(MAKECMDGOALS)),)
+ # poor man's `sed' emulation with make's built-in string functions
+ work := $(strip $(shell $(CAT) $(PUBLIC_DIR)/freetype.h))
+ work := $(subst |,x,$(work))
+ work := $(subst $(space),|,$(work))
+ work := $(subst \#define|FREETYPE_MAJOR|,$(space),$(work))
+ work := $(word 2,$(work))
+ major := $(subst |,$(space),$(work))
+ major := $(firstword $(major))
+
+ work := $(subst \#define|FREETYPE_MINOR|,$(space),$(work))
+ work := $(word 2,$(work))
+ minor := $(subst |,$(space),$(work))
+ minor := $(firstword $(minor))
+
+ work := $(subst \#define|FREETYPE_PATCH|,$(space),$(work))
+ work := $(word 2,$(work))
+ patch := $(subst |,$(space),$(work))
+ patch := $(firstword $(patch))
+
+ version := $(major).$(minor).$(patch)
+endif
+
# We write-protect the docmaker directory to suppress generation
# of .pyc files.
#
@@ -274,7 +297,7 @@ refdoc:
-chmod -w $(SRC_DIR)/tools/docmaker
python $(SRC_DIR)/tools/docmaker/docmaker.py \
--prefix=ft2 \
- --title=FreeType-2.2.1 \
+ --title=FreeType-$(version) \
--output=$(DOC_DIR) \
$(PUBLIC_DIR)/*.h \
$(PUBLIC_DIR)/config/*.h \
diff --git a/builds/os2/detect.mk b/builds/os2/detect.mk
index 97e4bc9..47a40a2 100644
--- a/builds/os2/detect.mk
+++ b/builds/os2/detect.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,
@@ -29,6 +29,7 @@ ifeq ($(PLATFORM),os2)
COPY := copy
DELETE := del
+ CAT := type
SEP := $(BACKSLASH)
# gcc-emx by default
diff --git a/builds/os2/os2-def.mk b/builds/os2/os2-def.mk
index 6ca739e..01cda92 100644
--- a/builds/os2/os2-def.mk
+++ b/builds/os2/os2-def.mk
@@ -14,6 +14,7 @@
DELETE := del
+CAT := type
SEP := $(strip \ )
BUILD_DIR := $(TOP_DIR)/builds/os2
PLATFORM := os2
diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk
index aafe352..c4130f9 100644
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -31,6 +31,7 @@ endif # test PLATFORM ansi
ifeq ($(PLATFORM),unix)
COPY := cp
DELETE := rm -f
+ CAT := cat
# If `devel' is the requested target, we use a special configuration
# file named `unix-dev.mk'. It disables optimization and libtool.
diff --git a/builds/unix/unix-def.in b/builds/unix/unix-def.in
index 1241db6..b90ed0c 100644
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -17,6 +17,7 @@ TOP_DIR := $(shell cd $(TOP_DIR); pwd)
DELETE := @RMF@
DELDIR := @RMDIR@
+CAT := cat
SEP := /
# this is used for `make distclean' and `make install'
diff --git a/builds/unix/unixddef.mk b/builds/unix/unixddef.mk
index 991642e..130d6b0 100644
--- a/builds/unix/unixddef.mk
+++ b/builds/unix/unixddef.mk
@@ -20,6 +20,7 @@ OBJ_DIR := $(shell cd $(OBJ_DIR); pwd)
PLATFORM := unix
DELETE := rm -f
+CAT := cat
SEP := /
# we use a special devel ftoption.h
diff --git a/builds/win32/detect.mk b/builds/win32/detect.mk
index 97e7b52..71ab826 100644
--- a/builds/win32/detect.mk
+++ b/builds/win32/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,
@@ -65,6 +65,7 @@ endif # test PLATFORM ansi
ifeq ($(PLATFORM),win32)
DELETE := del
+ CAT := type
SEP := $(BACKSLASH)
# Setting COPY is a bit trickier. Plain COPY on NT will not work
diff --git a/builds/win32/win32-def.mk b/builds/win32/win32-def.mk
index 87dc12a..a82b146 100644
--- a/builds/win32/win32-def.mk
+++ b/builds/win32/win32-def.mk
@@ -14,6 +14,7 @@
DELETE := del
+CAT := type
SEP := $(strip \ )
BUILD_DIR := $(TOP_DIR)/builds/win32
PLATFORM := win32