ref: b26b314a9357ddb4a4819c36a59313d076396cea
parent: 4e1d6c0c518caae87c1285b9723d86b27d58fa67
author: Werner Lemberg <[email protected]>
date: Sat Dec 9 15:01:43 EST 2006
* 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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-12-09 Werner Lemberg <[email protected]>
+
+ * 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 <[email protected]>
* builds/toplevel.mk (dist): Extract version number from freetype.h.
--- 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
--- 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
--- 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 @@
ifeq ($(PLATFORM),beos)
DELETE := rm -f
+ CAT := cat
SEP := /
BUILD_DIR := $(TOP_DIR)/builds/beos
CONFIG_FILE := beos.mk
--- 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
--- a/builds/dos/detect.mk
+++ b/builds/dos/detect.mk
@@ -116,10 +116,12 @@
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
--- 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
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -267,6 +267,29 @@
$(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 @@
-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 \
--- 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 @@
COPY := copy
DELETE := del
+ CAT := type
SEP := $(BACKSLASH)
# gcc-emx by default
--- 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
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -31,6 +31,7 @@
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.
--- a/builds/unix/unix-def.in
+++ b/builds/unix/unix-def.in
@@ -17,6 +17,7 @@
DELETE := @RMF@
DELDIR := @RMDIR@
+CAT := cat
SEP := /
# this is used for `make distclean' and `make install'
--- a/builds/unix/unixddef.mk
+++ b/builds/unix/unixddef.mk
@@ -20,6 +20,7 @@
PLATFORM := unix
DELETE := rm -f
+CAT := cat
SEP := /
# we use a special devel ftoption.h
--- 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 @@
ifeq ($(PLATFORM),win32)
DELETE := del
+ CAT := type
SEP := $(BACKSLASH)
# Setting COPY is a bit trickier. Plain COPY on NT will not work
--- 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