removed trailing / from directories (given in files.mk)
[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
c08ba753
PG
27
28T_WARFLAGS :=
29T_WARFLAGS += -Wall
30T_WARFLAGS += -Wextra
31T_WARFLAGS += -pedantic
32T_WARFLAGS += -ansi
33T_WARFLAGS += -Wshadow
34T_WARFLAGS += -Wswitch-enum
35T_WARFLAGS += -Wfloat-equal
36T_WARFLAGS += -Wundef
bc38cb36 37T_WARFLAGS += -Wswitch-enum
3fc83b9f 38
7bbc50a4 39G_CXXFLAGS := ${T_WARFLAGS}
698cb4b6
PG
40ifeq (${G_BUILD},${B_DEBUG})
41 G_CXXFLAGS += ${T_DBGFLAGS}
42else
43ifeq (${G_BUILD},${B_FINAL})
7bbc50a4 44 G_CXXFLAGS += ${T_OPTFLAGS}
9cc902bf 45else
698cb4b6 46ifeq (${G_BUILD},${B_WIN32})
7bbc50a4 47 G_CXXFLAGS += ${T_OPTFLAGS}
9cc902bf 48else
698cb4b6
PG
49 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
50endif
9cc902bf
PG
51endif
52endif
3fc83b9f 53
7bbc50a4
PG
54T_OPTFLAGS :=
55T_DBGFLAGS :=
56T_PRFFLAGS :=
57T_WARFLAGS :=
58
a98a33a6 59G_LNKFLAGS :=
7bbc50a4 60
698cb4b6 61ifeq (${G_BUILD},${B_WIN32})
7bbc50a4 62 G_CXX := mingw32-g++
3fc83b9f 63else
7bbc50a4 64 G_CXX := g++
3fc83b9f
PG
65endif
66
698cb4b6 67ifeq (${G_BUILD},${B_WIN32})
b6a453de
PG
68 G_LIBGL := -lopengl32 -lglu32
69 G_LIBSDL := `/usr/mingw32/bin/sdl-config --libs`
70else
71 G_LIBGL := -lGL -lGLU
72 G_LIBSDL := `sdl-config --libs`
73endif
74
75c4965c
PG
75G_SRCSDIR := src/
76G_DEPSDIR := deps/
77
698cb4b6
PG
78ifeq (${G_BUILD},${B_DEBUG})
79 G_OBJSDIR := objsd/
80 G_BINDIR := bind/
75c4965c 81else
698cb4b6 82ifeq (${G_BUILD},${B_FINAL})
75c4965c
PG
83 G_OBJSDIR := objs/
84 G_BINDIR := bin/
85else
698cb4b6
PG
86ifeq (${G_BUILD},${B_WIN32})
87 G_OBJSDIR := objs-mingw32/
88 G_BINDIR := bin-mingw32/
89else
90 $(error 'G_BUILD = ${G_BUILD}' is invalid.)
91endif
75c4965c
PG
92endif
93endif
94
3994427d
PG
95LOGFILE := bld.log
96
97$(shell rm -f ${LOGFILE}) # remove the log file from last run
b6a453de 98
698cb4b6 99ifeq (${G_BUILD},${B_WIN32})
3fc83b9f 100 PRNTFMT := printf "%-12s: %s\n"
97c2dcb5 101 PRNTLOG := printf "\n\#\# %-12s: %s\n"
3fc83b9f
PG
102else
103 PRNTFMT := printf "%-8s: %s\n"
97c2dcb5 104 PRNTLOG := printf "\n\#\# %-8s: %s\n"
3fc83b9f
PG
105endif
106
107VERBOSE := 0
108
109ifeq (${VERBOSE},0)
3994427d
PG
110 # log the printf command
111 Q1s := @
112 Q1e := >> ${LOGFILE}
3fc83b9f 113 # quiet the printf command
3994427d
PG
114 Q2s := @
115 Q2e :=
116 # log the command
117 Q3s := @echo # NOTE: the space between @echo and the # is VERY important!!
118 Q3e := >> ${LOGFILE}
119 # quiet the command
120 Q4s := @
121 Q4e :=
3fc83b9f 122else
3994427d
PG
123 # EAT the logging printf command
124 Q1s := @true # NOTE: the space between @true and the # is VERY important!!
125 Q1e :=
126 # EAT the quiet printf command
127 Q2s := @true # NOTE: the space between @true and the # is VERY important!!
128 Q2e :=
129 # EAT the logging command
130 Q3s := @true # NOTE: the space between @true and the # is VERY important!!
131 Q3e :=
132 # do not quiet the command
133 Q4s :=
134 Q4e :=
3fc83b9f
PG
135endif
136
b6a453de 137
698cb4b6 138ifeq (${G_BUILD},${B_WIN32})
b6a453de
PG
139 prefix := /usr/mingw32
140else
141 prefix := /usr
142endif
143exec_prefix := ${prefix}
144includedir := ${prefix}/include
145libdir := ${exec_prefix}/lib
146INSTALL := install
147