From b26b314a9357ddb4a4819c36a59313d076396cea Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 9 Dec 2006 20:01:43 +0000 Subject: [PATCH] * 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. --- ChangeLog | 9 +++++++++ builds/ansi/ansi-def.mk | 1 + builds/beos/beos-def.mk | 1 + builds/beos/detect.mk | 3 ++- builds/detect.mk | 3 ++- builds/dos/detect.mk | 2 ++ builds/dos/dos-def.mk | 1 + builds/freetype.mk | 25 ++++++++++++++++++++++++- builds/os2/detect.mk | 3 ++- builds/os2/os2-def.mk | 1 + builds/unix/detect.mk | 1 + builds/unix/unix-def.in | 1 + builds/unix/unixddef.mk | 1 + builds/win32/detect.mk | 3 ++- builds/win32/win32-def.mk | 1 + 15 files changed, 51 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc589d9ae..dd84b19e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-12-09 Werner Lemberg + + * 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 * 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 6b8ecfab5..2c5857295 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 7e79d0438..4371a30aa 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 8333aba4f..24a087886 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 6d85f0cda..c3632c08a 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 cabc6d646..700a12268 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 c68bd74db..950f581a0 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 2afd8c898..9d9c23317 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 97e4bc972..47a40a2f8 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 6ca739ea0..01cda9285 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 aafe35276..c4130f9bc 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 1241db665..b90ed0c4c 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 991642e4f..130d6b0f6 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 97e7b5227..71ab8265c 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 87dc12a18..a82b146bf 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