2 # cause the fancy SS_ directory rules to work out
5 # The SS rules need to be 'recursive' so they evaluate the @ variables at
6 # secondary expansion time
9 # Warning this secondary expansion rule is very very sensitive
10 # tricks are needed to make things work because the stem % does not match
11 # empty also, it is used by the call syntax as the package variable needs to be
12 # invoked as usage time while the rest has to be delayed till secondary
14 SS_DEPSDIR = $(patsubst %/,%,$(patsubst ${OBJSDIR_$(1)}%,${DEPSDIR_$(1)}%,$(dir $@)))
21 # set this on the command line to get a WIN32 or a FINAL build
24 ifeq (${G_BUILD},${B_DEBUG})
26 ifeq (${G_BUILD},${B_FINAL})
28 ifeq (${G_BUILD},${B_WIN32})
30 $(error 'G_BUILD = ${G_BUILD}' is invalid. Valid types are '${B_DEBUG}', '${B_FINAL}' or '${B_WIN32}')
38 T_PRFFLAGS := ${T_DBGFLAGS} -pg
43 T_WARFLAGS += -pedantic
45 T_WARFLAGS += -Wshadow
46 T_WARFLAGS += -Wswitch-enum
47 T_WARFLAGS += -Wfloat-equal
49 T_WARFLAGS += -Wswitch-enum
51 G_CXXFLAGS := ${T_WARFLAGS}
52 ifeq (${G_BUILD},${B_DEBUG})
53 G_CXXFLAGS += ${T_DBGFLAGS}
55 ifeq (${G_BUILD},${B_FINAL})
56 G_CXXFLAGS += ${T_OPTFLAGS}
58 ifeq (${G_BUILD},${B_WIN32})
59 G_CXXFLAGS += ${T_OPTFLAGS}
61 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
73 ifeq (${G_BUILD},${B_WIN32})
79 ifeq (${G_BUILD},${B_WIN32})
80 G_LIBGL := -lopengl32 -lglu32
81 G_LIBSDL := `/usr/mingw32/bin/sdl-config --libs`
84 G_LIBSDL := `sdl-config --libs`
90 ifeq (${G_BUILD},${B_DEBUG})
94 ifeq (${G_BUILD},${B_FINAL})
98 ifeq (${G_BUILD},${B_WIN32})
99 G_OBJSDIR := objs-mingw32
100 G_BINDIR := bin-mingw32
102 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
109 $(shell rm -f ${LOGFILE}) # remove the log file from last run
111 ifeq (${G_BUILD},${B_WIN32})
112 PRNTFMT := printf "%-12s: %s\n"
113 PRNTLOG := printf "\n\#\# %-12s: %s\n"
115 PRNTFMT := printf "%-8s: %s\n"
116 PRNTLOG := printf "\n\#\# %-8s: %s\n"
122 # log the printf command
125 # quiet the printf command
129 Q3s := @echo # NOTE: the space between @echo and the # is VERY important!!
135 # EAT the logging printf command
136 Q1s := @true # NOTE: the space between @true and the # is VERY important!!
138 # EAT the quiet printf command
139 Q2s := @true # NOTE: the space between @true and the # is VERY important!!
141 # EAT the logging command
142 Q3s := @true # NOTE: the space between @true and the # is VERY important!!
144 # do not quiet the command
150 ifeq (${G_BUILD},${B_WIN32})
151 prefix := /usr/mingw32
155 exec_prefix := ${prefix}
156 includedir := ${prefix}/include
157 libdir := ${exec_prefix}/lib