From 42a29f2a85f306799ea9a2493e0544739982e31a Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 22 Jul 2000 06:59:36 +0000 Subject: [PATCH] For Unix platforms, `configure' will be always called now. The `devel' target no longer needs unix-dev.mk. Some other minor fixes. --- builds/unix/detect.mk | 46 +++++--------- builds/unix/unix-dev.mk | 134 ---------------------------------------- builds/unix/unix.in | 14 +++-- 3 files changed, 25 insertions(+), 169 deletions(-) delete mode 100644 builds/unix/unix-dev.mk diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk index 8271beac3..dec1baa79 100644 --- a/builds/unix/detect.mk +++ b/builds/unix/detect.mk @@ -22,50 +22,36 @@ ifeq ($(PLATFORM),ansi) COPY := cp DELETE := rm -f - # Test whether we are using gcc. If so, we select the `unix-gcc.mk' - # configuration file. Otherwise, the configure script is called and + # If a Unix platform is detected, the configure script is called and # `unix.mk' is created. # - # The use of the configure script can be forced by saying `make unix'; - # arguments to `configure' should be in the CFG variable. Example: + # Arguments to `configure' should be in the CFG variable. Example: # - # make unix CFG="--prefix=/usr --disable-static" + # make CFG="--prefix=/usr --disable-static" + # + # If you need to set CFLAGS or LDFLAGS, do it here also. # # Feel free to add support for other platform specific compilers in this # directory (e.g. solaris.mk + changes here to detect the platform). # - ifneq ($(findstring unix,$(MAKECMDGOALS)),) - CONFIG_FILE := unix.mk - setup: unix.mk - unix: setup - else - ifeq ($(firstword $(CC)),gcc) - is_gcc := 1 - else - ifneq ($(findstring gcc,$(shell $(CC) -v 2>&1)),) - is_gcc := 1 - endif - endif + CONFIG_FILE := unix.mk + setup: unix.mk + unix: setup - ifdef is_gcc - CONFIG_FILE := unix-gcc.mk - else - CONFIG_FILE := unix.mk - setup: unix.mk - endif - - # If `devel' is the requested target, use the development Makefile. - # - ifneq ($(findstring devel,$(MAKECMDGOALS)),) - CONFIG_FILE := unix-dev.mk - devel: setup + # If `devel' is the requested target, use `-g -O0' as the default value + # for CFLAGS if CFLAGS isn't set. + # + ifneq ($(findstring devel,$(MAKECMDGOALS)),) + ifndef CFLAGS + USE_CFLAGS := CFLAGS="-g -O0" endif + devel: setup endif setup: std_setup unix.mk: builds/unix/unix.in - cd builds/unix; ./configure $(CFG) + cd builds/unix; $(USE_CFLAGS) ./configure $(CFG) endif # test Unix endif # test PLATFORM diff --git a/builds/unix/unix-dev.mk b/builds/unix/unix-dev.mk deleted file mode 100644 index 5cd5bebcd..000000000 --- a/builds/unix/unix-dev.mk +++ /dev/null @@ -1,134 +0,0 @@ -# -# FreeType 2 configuration rules for the gcc compiler under UNIX -# -# Development version without optimizations. -# - - -# Copyright 1996-2000 by -# David Turner, Robert Wilhelm, and Werner Lemberg. -# -# This file is part of the FreeType project, and may only be used, modified, -# and distributed under the terms of the FreeType project license, -# LICENSE.TXT. By continuing to use, modify, or distribute this file you -# indicate that you have read the license and understand and accept it -# fully. - - -ifndef TOP - TOP := . -endif - -DELETE := rm -f -SEP := / -HOSTSEP := $(SEP) -BUILD := $(TOP)/builds/unix -PLATFORM := unix - -# The directory where all object files are placed. -# -# 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. -# -# By default, this is the same as $(OBJ_DIR), however, this can be changed -# to suit particular needs. -# -LIB_DIR := $(OBJ_DIR) - - -# The object file extension. This can be .o, .tco, .obj, etc., depending on -# the platform. -# -O := o - -# The library file extension. This can be .a, .lib, etc., depending on the -# platform. -# -A := a - - -# The name of the final library file. Note that the DOS-specific Makefile -# uses a shorter (8.3) name. -# -LIBRARY := libfreetype - - -# Path inclusion flag. Some compilers use a different flag than `-I' to -# specify an additional include path. Examples are `/i=' or `-J'. -# -I := -I - - -# C flag used to define a macro before the compilation of a given source -# object. Usually is `-D' like in `-DDEBUG'. -# -D := -D - - -# The link flag used to specify a given library file on link. Note that -# this is only used to compile the demo programs, not the library itself. -# -L := -l - - -# Target flag. -# -T := -o # Don't remove this comment line! We need the space after `-o'. - - -# C flags -# -# These should concern: debug output, optimization & warnings. -# -# Use the ANSIFLAGS variable to define the compiler flags used to enfore -# ANSI compliance. -# -ifndef CFLAGS - CFLAGS := -c -g -O0 -Wall -endif - -# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. -# -ANSIFLAGS := -ansi -pedantic - - -ifdef BUILD_FREETYPE - - # Now include the main sub-makefile. It contains all the rules used to - # build the library with the previous variables defined. - # - include $(TOP)/builds/freetype.mk - - # The cleanup targets. - # - clean_freetype: clean_freetype_std - distclean_freetype: distclean_freetype_std - - # Librarian to use to build the static library - # - FT_LIBRARIAN := $(AR) -r - - - # 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} - # - $(FT_LIBRARY): $(OBJECTS_LIST) - -$(DELETE) $@ - $(FT_LIBRARIAN) $@ $(OBJECTS_LIST) - -endif - -# EOF diff --git a/builds/unix/unix.in b/builds/unix/unix.in index 115d786c8..9b874c274 100644 --- a/builds/unix/unix.in +++ b/builds/unix/unix.in @@ -108,9 +108,7 @@ T := -o # Don't remove this comment line! We need the space after `-o'. # Use the ANSIFLAGS variable to define the compiler flags used to enfore # ANSI compliance. # -ifndef CFLAGS - CFLAGS := -c @CFLAGS@ @XX_CFLAGS@ -endif +CFLAGS := -c @XX_CFLAGS@ @CFLAGS@ # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # @@ -119,7 +117,13 @@ ANSIFLAGS := @XX_ANSIFLAGS@ # C compiler to use -- we use libtool! # # -CC := $(BUILD)/libtool --mode=compile $(CC) +CCraw := $(CC) +CC := $(BUILD)/libtool --mode=compile $(CCraw) + +# linker flags +# +LDFLAGS := @LDFLAGS@ + ifdef BUILD_FREETYPE @@ -147,7 +151,7 @@ ifdef BUILD_FREETYPE # Librarian to use to build the static library # - FT_LIBRARIAN := $(BUILD)/libtool --mode=link $(CC) + FT_LIBRARIAN := $(BUILD)/libtool --mode=link $(CCraw) # This final rule is used to link all object files into a single library.