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