@ -5,9 +5,25 @@ all: exes
# TOP is the directory where the main FreeType source is found,
# as well as the 'config.mk' file
#
# TOP2 is the directory is the top of the demonstration
# programs directory
#
i f n d e f T O P
TOP := ..
TOP := ..
e n d i f
i f n d e f T O P 2
TOP2 := $( TOP) /demos
e n d i f
######################################################################
#
# MY_CONFIG_MK points to the current "config.mk" to use. It is
# defined by default as $(TOP)/config.mk
#
i f n d e f C O N F I G _ M K
CONFIG_MK := $( TOP) /config.mk
e n d i f
####################################################################
@ -15,15 +31,15 @@ endif
# Check that we have a working `config.mk' in the above directory.
# If not, issue a warning message, then stop there..
#
i f e q ( $( wildcard $ ( TOP ) /config .mk ) , )
i f e q ( $ w i l d c a r d $( CONFIG_MK ) , )
no_config_mk := 1
e n d i f
i f d e f n o _ c o n f i g _ m k
exes :
@echo Please compile the library before the demo programs!
clean distclean :
@echo "I need \`../config.mk' to do that!"
@echo I need " $( TOP) /config.mk " to do that !!
e l s e
####################################################################
@ -31,7 +47,7 @@ else
# Good, now include the `config.mk' in order to know how to build
# object files from sources, as well as other things (compiler flags)
#
i n c l u d e . . / c o n f i g . m k
i n c l u d e $( CONFIG_MK )
####################################################################
#
@ -79,35 +95,55 @@ endif
i f d e f D O S L I K E
clean_demo :
-del obj\* .$O
-del s rc\* .bak
-del obj\* .$O 2> nul
-del $( subst /,\, $( TOP2) ) \s rc\* .bak 2> nul
distclean_demo : clean_demo
-del obj\* .*
-del bin\* .exe
-del obj\* .lib 2> nul
-del bin\* .exe 2> nul
e l s e
clean_demo :
-$( DELETE) $( OBJ_) *.$O
-$( DELETE) $( SRC_) *.bak graph$( SEP) *.bak
-$( DELETE) $( SRC_) *~ graph$( SEP) *~
distclean_demo : clean_demo
-$( DELETE) $( EXES:%= $( BIN_) %)
-$( DELETE) $( EXES:%= $( BIN_) %$E )
-$( DELETE) $( GRAPH_LIB)
e n d i f
clean : clean_demo
distclean : distclean_demo
####################################################################
#
# Define a few important variables now
#
#
TOP_ := $( TOP) $( SEP)
TOP2_ := $( TOP2) $( SEP)
SRC_ := $( TOP) $( SEP) src$( SEP)
BIN_ := bin$( SEP)
OBJ_ := obj$( SEP)
GRAPH_DIR := $( TOP2_) graph
SRC_DIR := $( TOP2_) src
SRC_DIR_ := $( SRC_DIR) $( SEP)
FT_INCLUDES := $( BUILD) $( TOP_) include $( SRC_) base
FT_INCLUDES := $( BUILD) $( TOP_) include $( SRC_) base $( SRC_DIR)
TT_INCLUDES := $( SRC_) shared $( SRC_) truetype
T1_INCLUDES := $( SRC_) shared $( SRC_) type1
CFLAGS = -c -O0 -g $( INCLUDES:%= $I %) -Wall -W -ansi
CC := $( CC)
LINK := $( CC)
FTLIB := $( LIB_DIR) $( SEP) $( LIBRARY) .$A
COMPILE = $( CC) $( CFLAGS) $( INCLUDES:%= $I %)
LINK := $( CC)
FTLIB := $( TOP_) $( LIB_DIR) $( SEP) $( LIBRARY) .$A
LINK = $( CC) $( LINKT) $@ $< $( FTLIB) $( EFENCE)
COMMON_LINK = $( COMMON_OBJ)
####################################################################
#
@ -140,28 +176,33 @@ INCLUDES := $(FT_INCLUDES)
# Rules for compiling object files for text-only demos
#
COMMON_OBJ := $( OBJ_) common.o
COMMON_OBJ := $( OBJ_) common.$O
$(COMMON_OBJ) : $( SRC_DIR_ ) common .c
$( CC) $( CFLAGS) $T $@ $<
i f d e f D O S L I K E
$( COMPILE) $T $@ $< $DEXPAND_WILDCARDS
e l s e
$( COMPILE) $T $@ $<
e n d i f
$(OBJ_)%.$O : $( SRC_DIR_ ) %.c $( FTLIB )
$( CC) $( CFLAGS) $T $@ $<
$( COMPILE ) $T $@ $<
$(OBJ_)ftlint.$O : $( SRC_DIR_ ) ftlint .c
$( CC) $( CFLAGS ) $T $@ $<
$( COMPILE ) $T $@ $<
$(OBJ_)fttry.$O : $( SRC_DIR_ ) fttry .c
$( CC) $( CFLAGS ) $T $@ $<
$( COMPILE ) $T $@ $<
$(OBJ_)ftview.$O : $( SRC_DIR_ ) ftview .c $( GRAPH_LIB )
$( CC) $( CFLAGS ) $( GRAPH_INCLUDES:%= $I %) $T $@ $<
$( COMPILE ) $( GRAPH_INCLUDES:%= $I %) $T $@ $<
$(OBJ_)fttimer.$O : $( SRC_DIR_ ) fttimer .c $( GRAPH_LIB )
$( CC) $( CFLAGS ) $( GRAPH_INCLUDES:%= $I %) $T $@ $<
$( COMPILE ) $( GRAPH_INCLUDES:%= $I %) $T $@ $<
#$(OBJ_)ftsbit.$O: $(SRC_DIR)/ftsbit.c $(GRAPH_LIB)
# $(CC) $(CFLAGS ) $T$@ $<
# $(COMPILE ) $T$@ $<
####################################################################
@ -170,7 +211,7 @@ $(OBJ_)fttimer.$O: $(SRC_DIR_)fttimer.c $(GRAPH_LIB)
# the Type1 source path
#
$(OBJ_)t1dump.$O : $( SRC_DIR ) /t 1dump .c
$( CC) $( CFLAGS ) $( T1_INCLUDES:%= $I %) $T $@ $<
$( COMPILE ) $( T1_INCLUDES:%= $I %) $T $@ $<
####################################################################
@ -188,7 +229,7 @@ EXTRAFLAGS = $DUNIX $DHAVE_POSIX_TERMIOS
e n d i f
$(OBJ_)ttdebug.$O : $( SRC_DIR ) /ttdebug .c
$( CC) $( CFLAGS ) $( TT_INCLUDES:%= $I %) $T $@ $< $( EXTRAFLAGS)
$( COMPILE ) $( TT_INCLUDES:%= $I %) $T $@ $< $( EXTRAFLAGS)
####################################################################
@ -197,29 +238,30 @@ $(OBJ_)ttdebug.$O: $(SRC_DIR)/ttdebug.c
# over-ridden by system-specific things..
#
$(BIN_)ftlint$E : $( OBJ_ ) ftlint .$O $( FTLIB )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( EFENCE )
$(BIN_)ftlint$E : $( OBJ_ ) ftlint .$O $( FTLIB ) $( COMMON_OBJ )
$( COMMON_LINK )
$(BIN_)fttry$E : $( OBJ_ ) fttry .$O $( FTLIB )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( EFENCE)
$( LINK)
$(BIN_)ftsbit$E : $( OBJ_ ) ftsbit .$O $( FTLIB )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( EFENCE)
$( LINK)
$(BIN_)t1dump$E : $( OBJ_ ) t 1dump .$O $( FTLIB )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( EFENCE)
$( LINK)
$(BIN_)ttdebug$E : $( OBJ_ ) ttdebug .$O $( FTLIB )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( EFENCE)
$( LINK)
$(BIN_)ftview$E : $( OBJ_ ) ftview .$O $( FTLIB ) $( GRAPH_LIB ) $( COMMON_OBJ )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( GRAPH_LINK) $( COMMON_OBJ) $( EFENCE)
$( GRAPH_LINK)
$(BIN_)fttimer$E : $( OBJ_ ) fttimer .$O $( FTLIB ) $( GRAPH_LIB ) $( COMMON_OBJ )
$( LINK) $( LFLAGS) $T $@ $< $( FTLIB) $( GRAPH_LINK) $( EFENCE)
$( GRAPH_LINK)
e n d i f