From 281f9f6a134476ff7de3e506124b80463db5de56 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 17 Jan 2000 11:20:26 +0000 Subject: [PATCH] Important changes were performed to clean up the makefiles, these will be detailed later in a document (the work is not completely finished). --- config/ansi/Makefile | 29 ++++++++++++++++++++++---- config/detect.mk | 2 +- config/dos/MAKEFILE.GCC | 30 +++++++++++++++++++++++---- config/freetype.mk | 35 +++++++++++++++++++++++-------- config/modules.mk | 4 ++-- config/os2/Makefile.emx | 29 ++++++++++++++++++++++---- config/os2/makefile.devel | 29 ++++++++++++++++++++++---- config/os2/makefile.gcc | 42 ++++++++++++++++++++++---------------- config/unix/Makefile | 29 ++++++++++++++++++++++---- config/unix/Makefile.devel | 29 ++++++++++++++++++++++---- config/win32/Makefile.gcc | 31 +++++++++++++++++++++++----- config/win32/Makefile.lcc | 30 +++++++++++++++++++++++---- config/win32/Makefile.vcc | 31 ++++++++++++++++++++-------- 13 files changed, 278 insertions(+), 72 deletions(-) diff --git a/config/ansi/Makefile b/config/ansi/Makefile index 07db19262..bd39e4f1b 100644 --- a/config/ansi/Makefile +++ b/config/ansi/Makefile @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,12 +85,23 @@ endif DELETE := rm -f SEP := / +HOSTSEP := $(SEP) BUILD := $(TOP)/config/ansi PLATFORM := ansi # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -155,11 +169,18 @@ ifndef CFLAGS CFLAGS := -c endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := + # Now include the main sub-makefile. It contains all the rules used # to build the library with the previous variables defined # include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_std +distclean_freetype: clean_freetype_library_std # Librarian to use to build the static library # diff --git a/config/detect.mk b/config/detect.mk index 0dcc7c9a0..bef99420c 100644 --- a/config/detect.mk +++ b/config/detect.mk @@ -123,5 +123,5 @@ dos_setup: @echo ÿ @echo Otherwise, simple type 'make' again to build the library @echo ÿ - @$(COPY) $(CONFIG_RULES) $(CONFIG_MK) > nul + @$(COPY) $(subst /,\,$(CONFIG_RULES) $(CONFIG_MK)) > nul diff --git a/config/dos/MAKEFILE.GCC b/config/dos/MAKEFILE.GCC index a7642cbe2..6d609387a 100644 --- a/config/dos/MAKEFILE.GCC +++ b/config/dos/MAKEFILE.GCC @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,12 +85,23 @@ endif DELETE := rm -f SEP := / +HOSTSEP := $(strip \ ) BUILD := $(TOP)/config/dos PLATFORM := dos # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -154,10 +168,18 @@ ifndef CFLAGS CFLAGS := -c -g -O6 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos + # This final rule is used to link all object files into a single # library. It is part of the system-specific sub-Makefile because not diff --git a/config/freetype.mk b/config/freetype.mk index 711e0aecf..93764b281 100644 --- a/config/freetype.mk +++ b/config/freetype.mk @@ -84,7 +84,7 @@ INCLUDE_FLAGS = $(INCLUDES:%=$I%) # FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS) FT_CC = $(CC) $(FT_CFLAGS) -FT_COMPILE = $(FT_CC) +FT_COMPILE = $(CC) $(ANSI_FLAGS) $(FT_CFLAGS) # @@ -160,10 +160,10 @@ $(FTINIT_OBJ): $(FTINIT_SRC) $(BASE_H) $(FTINIT_DRIVER_H) $(FT_MODULE_LIST) # ommitted on builds which do not want them. # OBJ_M = $(BASE_OBJ_M) $(BASE_EXT_OBJ) $(DRV_OBJS_M) \ - $(FTSYS_OBJ) $(FTINIT_OBJ) $(FTDEBUG_OBJ) + $(FTINIT_OBJ) OBJ_S = $(BASE_OBJ_S) $(BASE_EXT_OBJ) $(DRV_OBJS_S) \ - $(FTSYS_OBJ) $(FTINIT_OBJ) $(FTDEBUG_OBJ) + $(FTINIT_OBJ) ifneq ($(findstring multi,$(MAKECMDGOALS)),) OBJECTS_LIST += $(OBJ_M) @@ -179,17 +179,34 @@ library: $(FT_LIBRARY) $(FT_COMPILE) $T$@ $< -clean_freetype: - -$(DELETE) $(OBJ_S:/=$(SEP)) $(OBJ_M:/=$(SEP)) - +# Standard cleaning and distclean rules. These are not accepted +# on all systems though.. +# +clean_freetype_std: + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(OBJ_S) $(OBJ_M)) -distclean_freetype: clean_freetype - -$(DELETE) $(FT_LIBRARY:/=$(SEP)) +distclean_freetype_std: clean_freetype_std + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) -$(DELETE) *.orig *~ core *.core +# The Dos command shell does not support very long list of arguments +# so we're stuck with wildcards +# +#SYSOBJ_ := $(subst $(SEP),\,$(OBJ_)) + +clean_freetype_dos: + -del $(subst $(SEP),$(HOSTSEP),$(OBJ_))*.$O 2> nul + +distclean_freetype_dos: clean_freetype_dos + -del $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul + remove_config_mk: - -$(DELETE) $(CONFIG_MK:/=$(SEP)) + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(CONFIG_MK)) 2> nul +# the "config.mk" must define 'clean_freetype' and 'distclean_freetype' +# implementations may use to relay these to either the 'std' or 'dos' +# versions, or simply provide their own implementation.. +# clean: clean_freetype distclean: distclean_freetype remove_config_mk diff --git a/config/modules.mk b/config/modules.mk index 0ad7db171..56678d9cb 100644 --- a/config/modules.mk +++ b/config/modules.mk @@ -36,8 +36,8 @@ FT_MODULE_LIST := $(BUILD)$(SEP)ftmodule.h # file in order to `clean' the list # clean_module_list: - @$(DELETE) $(FT_MODULE_LIST) - @echo Regenerating the font drivers list in '$(FT_MODULE_LIST)' + @-$(DELETE) $(FT_MODULE_LIST) + @-echo Regenerating the font drivers list in $(FT_MODULE_LIST) make_module_list: clean_module_list @echo -- done -- diff --git a/config/os2/Makefile.emx b/config/os2/Makefile.emx index 75394ead8..5d3446daa 100644 --- a/config/os2/Makefile.emx +++ b/config/os2/Makefile.emx @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,13 +85,24 @@ endif DELETE := del SEP := / +HOSTSEP := $(strip \ ) BUILD := $(TOP)/config/os2 PLATFORM := os2 CC := gcc # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -155,11 +169,18 @@ ifndef CFLAGS CFLAGS := -c -g -O6 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos # Librarian to use to build the static library # diff --git a/config/os2/makefile.devel b/config/os2/makefile.devel index f390f7980..0f413a4a7 100644 --- a/config/os2/makefile.devel +++ b/config/os2/makefile.devel @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -78,13 +81,24 @@ DELETE := del SEP := / +HOSTSEP := $(strip \ ) BUILD := $(TOP)/config/os2 PLATFORM := os2 CC := gcc # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -151,11 +165,18 @@ ifndef CFLAGS CFLAGS := -c -g -O0 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos # Librarian to use to build the static library # diff --git a/config/os2/makefile.gcc b/config/os2/makefile.gcc index dfd041cbe..9f03e522d 100644 --- a/config/os2/makefile.gcc +++ b/config/os2/makefile.gcc @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -78,13 +81,24 @@ DELETE := del SEP := / +HOSTSEP := $(strip \ ) BUILD := $(TOP)/config/os2 PLATFORM := os2 CC := gcc # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -151,26 +165,18 @@ ifndef CFLAGS CFLAGS := -c -g -O0 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk -# A rule used to clean all objects from OBJ_DIR -# -# The OS/2 command shell does not support very long list of arguments -# so we're stuck with wildcards -# - -DIR_OBJ := $(subst $(SEP),\,$(OBJ_DIR)) - -clean_freetype_objects: - -del $(DIR8OBJ)\*.$O - -clean_freetype_lib: - -del $(FT_LIBRARY) +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos -clean: clean_freetype_objects # Librarian to use to build the static library # diff --git a/config/unix/Makefile b/config/unix/Makefile index 59c08feed..779b0d87c 100644 --- a/config/unix/Makefile +++ b/config/unix/Makefile @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,12 +85,23 @@ endif DELETE := rm -f SEP := / +HOSTSEP := $(SEP) BUILD := $(TOP)/config/unix PLATFORM := unix # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -154,10 +168,17 @@ ifndef CFLAGS CFLAGS := -c -g -O6 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_std +distclean_freetype: clean_freetype_library_std # This final rule is used to link all object files into a single # library. It is part of the system-specific sub-Makefile because not diff --git a/config/unix/Makefile.devel b/config/unix/Makefile.devel index 8710a7c10..548637bd1 100644 --- a/config/unix/Makefile.devel +++ b/config/unix/Makefile.devel @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,12 +85,23 @@ endif DELETE := rm -f SEP := / +HOSTSEP := $(SEP) BUILD := $(TOP)/config/unix PLATFORM := unix # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -154,10 +168,17 @@ ifndef CFLAGS CFLAGS := -c -g -O0 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_std +distclean_freetype: distclean_freetype_std # This final rule is used to link all object files into a single # library. It is part of the system-specific sub-Makefile because not diff --git a/config/win32/Makefile.gcc b/config/win32/Makefile.gcc index b81a5c6f0..fcfb2f513 100644 --- a/config/win32/Makefile.gcc +++ b/config/win32/Makefile.gcc @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,13 +85,24 @@ endif DELETE := del SEP := / +HOSTSEP := $(strip \ ) BUILD := $(TOP)/config/win32 PLATFORM := win32 CC := gcc # the directory where all object files are placed # -OBJ_DIR := $(TOP)/obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -155,11 +169,18 @@ ifndef CFLAGS CFLAGS := -c -g -O6 -Wall endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := -ansi -pedantic ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos + # Librarian to use to build the static library # FT_LIBRARIAN := $(AR) -r @@ -172,7 +193,7 @@ FT_LIBRARIAN := $(AR) -r # librarian library_file {list of object files} # $(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $@ + -$(DELETE) $(subst $(SEP),$(HOSTSEP),$(FT_LIBRARY)) 2> nul $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) endif diff --git a/config/win32/Makefile.lcc b/config/win32/Makefile.lcc index d2cd03ddc..46c2afb47 100644 --- a/config/win32/Makefile.lcc +++ b/config/win32/Makefile.lcc @@ -30,9 +30,12 @@ #* BUILD Pathname to the platform-specific files used #* for the build. Usually `$(TOP)/config/' #* -#* SEP Directory separator for the current platform. -#* Either / or \ (maybe : on Macs) -#* +#* SEP Directory separator used during compilation. +#* (usually "/" or "\"). Note that on Win32, both gcc +#* and Visual C++ use "/" as a directory separator !! +#* +#* HOSTSEP Directory separator for $(COPY) and $(DELETE) +#* #* DELETE The forced remove/delete command to erase one or more #* files #* @@ -82,13 +85,24 @@ endif DELETE := del SEP := / +HOSTSEP := \\ BUILD := $(TOP)$(SEP)config$(SEP)win32 PLATFORM := win32 CC := lcc # the directory where all object files are placed # -OBJ_DIR := $(TOP)$(SEP)obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -156,10 +170,18 @@ ifndef CFLAGS CFLAGS := -c -g2 -O endif +# ANSIFLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSIFLAGS := + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos + # This final rule is used to link all object files into a single # library. It is part of the system-specific sub-Makefile because not # all librarians accept a simple syntax like : diff --git a/config/win32/Makefile.vcc b/config/win32/Makefile.vcc index eb251c688..230e31a4f 100644 --- a/config/win32/Makefile.vcc +++ b/config/win32/Makefile.vcc @@ -78,13 +78,24 @@ DELETE := del SEP := / +HOSTSEP := $(strip \ ) BUILD := $(TOP)$(SEP)config$(SEP)win32 PLATFORM := win32 CC := cl # the directory where all object files are placed # -OBJ_DIR := $(TOP)$(SEP)obj +# Note that this is not $(TOP)/obj !! +# This lets you build the library in your own directory +# with something like : +# +# set TOP=....../path/to/freetype2/top/dir... +# mkdir obj +# make -f %TOP%/Makefile setup [options] +# make -f %TOP%/Makefile +# +# +OBJ_DIR := obj # the directory where all library files are placed @@ -147,27 +158,29 @@ T := /Fo # - ansi compliance.. # ifndef CFLAGS -CFLAGS := /nologo /c /Ox /G5 /Za /W3 /WX +CFLAGS := /nologo /c /Ox /G5 /W3 /WX endif +# ANSI_FLAGS : put there the flags used to make your compiler ANSI-compliant +# nothing (if it already is by default like LCC). +# +ANSI_FLAGS := /Za + ifdef BUILD_FREETYPE include $(TOP)/config/freetype.mk +clean_freetype: clean_freetype_dos +distclean_freetype: distclean_freetype_dos + # This final rule is used to link all object files into a single # library. It is part of the system-specific sub-Makefile because not # all librarians accept a simple syntax like : # # librarian library_file {list of object files} # -# The LCC-Win32 Librarian, called LCCLIB needs all object files in the current -# directory. That _is_ stupid, but we'll have to deal with it.. -# - -DIR_OBJ := $(subst /,\\,$(OBJ_DIR)) - $(FT_LIBRARY): $(OBJECTS_LIST) - lib /out:$@ $(OBJECTS_LIST) + lib /nologo /out:$@ $(OBJECTS_LIST) endif