first run implementation of Queue
[libbear.git] / vars.mk
CommitLineData
3fc83b9f 1
698cb4b6
PG
2# cause the fancy $${@D} directory rules to work out
3.SECONDEXPANSION:
4
5B_DEBUG := DEBUG
6B_FINAL := FINAL
7B_WIN32 := WIN32
8
9# set this on the command line to get a WIN32 or a FINAL build
10G_BUILD := ${B_DEBUG}
11
12ifeq (${G_BUILD},${B_DEBUG})
13else
14ifeq (${G_BUILD},${B_FINAL})
15else
16ifeq (${G_BUILD},${B_WIN32})
17else
18 $(error 'G_BUILD = ${G_BUILD}' is invalid. Valid types are '${B_DEBUG}', '${B_FINAL}' or '${B_WIN32}')
19endif
20endif
21endif
22
23
7bbc50a4
PG
24T_OPTFLAGS := -O2
25T_DBGFLAGS := -ggdb
a98a33a6 26T_PRFFLAGS := ${T_DBGFLAGS} -pg
7bbc50a4 27T_WARFLAGS := -Wall -Wextra -pedantic -ansi
3fc83b9f 28
7bbc50a4 29G_CXXFLAGS := ${T_WARFLAGS}
698cb4b6
PG
30ifeq (${G_BUILD},${B_DEBUG})
31 G_CXXFLAGS += ${T_DBGFLAGS}
32else
33ifeq (${G_BUILD},${B_FINAL})
7bbc50a4 34 G_CXXFLAGS += ${T_OPTFLAGS}
9cc902bf 35else
698cb4b6 36ifeq (${G_BUILD},${B_WIN32})
7bbc50a4 37 G_CXXFLAGS += ${T_OPTFLAGS}
9cc902bf 38else
698cb4b6
PG
39 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
40endif
9cc902bf
PG
41endif
42endif
3fc83b9f 43
7bbc50a4
PG
44T_OPTFLAGS :=
45T_DBGFLAGS :=
46T_PRFFLAGS :=
47T_WARFLAGS :=
48
a98a33a6 49G_LNKFLAGS :=
7bbc50a4 50
698cb4b6 51ifeq (${G_BUILD},${B_WIN32})
7bbc50a4 52 G_CXX := mingw32-g++
3fc83b9f 53else
7bbc50a4 54 G_CXX := g++
3fc83b9f
PG
55endif
56
698cb4b6 57ifeq (${G_BUILD},${B_WIN32})
b6a453de
PG
58 G_LIBGL := -lopengl32 -lglu32
59 G_LIBSDL := `/usr/mingw32/bin/sdl-config --libs`
60else
61 G_LIBGL := -lGL -lGLU
62 G_LIBSDL := `sdl-config --libs`
63endif
64
75c4965c
PG
65G_SRCSDIR := src/
66G_DEPSDIR := deps/
67
698cb4b6
PG
68ifeq (${G_BUILD},${B_DEBUG})
69 G_OBJSDIR := objsd/
70 G_BINDIR := bind/
75c4965c 71else
698cb4b6 72ifeq (${G_BUILD},${B_FINAL})
75c4965c
PG
73 G_OBJSDIR := objs/
74 G_BINDIR := bin/
75else
698cb4b6
PG
76ifeq (${G_BUILD},${B_WIN32})
77 G_OBJSDIR := objs-mingw32/
78 G_BINDIR := bin-mingw32/
79else
80 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
81endif
75c4965c
PG
82endif
83endif
84
b6a453de 85
698cb4b6 86ifeq (${G_BUILD},${B_WIN32})
3fc83b9f
PG
87 PRNTFMT := printf "%-12s: %s\n"
88else
89 PRNTFMT := printf "%-8s: %s\n"
90endif
91
92VERBOSE := 0
93
94ifeq (${VERBOSE},0)
95 # quiet the printf command
96 Q1 := @
97 # quiet the command that is `replaced' by an echo
98 Q2 := @
99else
100 # EAT the printf command as if it was not there
101 Q1 := @true # NOTE: the space between @true and the # is VERY important!!
102 # do not quiet the command output
103 Q2 :=
104endif
105
b6a453de 106
698cb4b6 107ifeq (${G_BUILD},${B_WIN32})
b6a453de
PG
108 prefix := /usr/mingw32
109else
110 prefix := /usr
111endif
112exec_prefix := ${prefix}
113includedir := ${prefix}/include
114libdir := ${exec_prefix}/lib
115INSTALL := install
116