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 $@)))
22 # set this on the command line to get a WIN32 or a FINAL build
25 ifeq (${G_BUILD},${B_DEBUG})
27 ifeq (${G_BUILD},${B_FINAL})
29 ifeq (${G_BUILD},${B_WIN32})
31 ifeq (${G_BUILD},${B_CYGWIN})
33 $(error 'G_BUILD = ${G_BUILD}' is invalid. Valid types are '${B_DEBUG}', '${B_FINAL}', '${B_CYGWIN}', or '${B_WIN32}')
42 T_PRFFLAGS := ${T_DBGFLAGS} -pg
47 T_WARFLAGS += -pedantic
49 T_WARFLAGS += -Wshadow
50 T_WARFLAGS += -Wswitch-enum
51 T_WARFLAGS += -Wfloat-equal
53 T_WARFLAGS += -Wswitch-enum
55 G_CXXFLAGS := ${T_WARFLAGS}
56 ifeq (${G_BUILD},${B_DEBUG})
57 G_CXXFLAGS += ${T_DBGFLAGS}
59 ifeq (${G_BUILD},${B_FINAL})
60 G_CXXFLAGS += ${T_OPTFLAGS}
62 ifeq (${G_BUILD},${B_WIN32})
63 G_CXXFLAGS += ${T_OPTFLAGS}
65 ifeq (${G_BUILD},${B_CYGWIN})
66 G_CXXFLAGS += ${T_OPTFLAGS}
68 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
81 ifeq (${G_BUILD},${B_WIN32})
87 ifeq (${G_BUILD},${B_DEBUG})
89 G_LIBSDL := `sdl-config --libs`
91 ifeq (${G_BUILD},${B_FINAL})
93 G_LIBSDL := `sdl-config --libs`
95 ifeq (${G_BUILD},${B_WIN32})
96 G_LIBGL := -lopengl32 -lglu32
97 G_LIBSDL := `/usr/mingw32/bin/sdl-config --libs`
99 ifeq (${G_BUILD},${B_CYGWIN})
100 G_LIBGL := -lopengl32 -lglu32
101 G_LIBSDL := `sdl-config --libs`
103 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
111 ifeq (${G_BUILD},${B_DEBUG})
116 ifeq (${G_BUILD},${B_FINAL})
121 ifeq (${G_BUILD},${B_WIN32})
122 G_OBJSDIR := objs-mingw32
123 G_BINDIR := bin-mingw32
124 G_DEPSDIR := deps-mingw32
126 ifeq (${G_BUILD},${B_CYGWIN})
127 G_OBJSDIR := objs-cygwin
128 G_BINDIR := bin-cygwin
129 G_DEPSDIR := deps-cygwin
131 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
139 $(shell rm -f ${LOGFILE}) # remove the log file from last run
141 ifeq (${G_BUILD},${B_WIN32})
142 PRNTFMT := printf "%-12s: %s\n"
143 PRNTLOG := printf "\n\#\# %-12s: %s\n"
145 PRNTFMT := printf "%-8s: %s\n"
146 PRNTLOG := printf "\n\#\# %-8s: %s\n"
152 # log the printf command
155 # quiet the printf command
159 Q3s := echo # NOTE: the space between @echo and the # is VERY important!!
161 # quiet the command, log the output
162 Q4s := set -o pipefail &&
163 Q4e := 2>&1 | tee -a ${LOGFILE}
165 # EAT the logging printf command
166 Q1s := true # NOTE: the space between @true and the # is VERY important!!
168 # EAT the quiet printf command
169 Q2s := true # NOTE: the space between @true and the # is VERY important!!
171 # EAT the logging command
172 Q3s := true # NOTE: the space between @true and the # is VERY important!!
174 # do not quiet the command
180 ifeq (${G_BUILD},${B_WIN32})
181 prefix := /usr/mingw32
185 exec_prefix := ${prefix}
186 includedir := ${prefix}/include
187 libdir := ${exec_prefix}/lib