-
Notifications
You must be signed in to change notification settings - Fork 6
/
config
309 lines (247 loc) · 12 KB
/
config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#------------------------------------------------------------------------------
# Platform to build against [Choices: posix, winnt]:
#------------------------------------------------------------------------------
PLATFORM ?= posix
#------------------------------------------------------------------------------
# Dynamic link library extension [Choices: .so, .dll, .sl, ...]:
#------------------------------------------------------------------------------
DLLEXT = .so
#------------------------------------------------------------------------------
# Default display driver [Choices: x11, rawfb, directfb, windows]:
# If you enable rawfb, see RAWFB_SUB_DEVICE below and visit src/Makefile
# and tek/lib/Makefile if you want to stack it on top of another driver.
#------------------------------------------------------------------------------
DISPLAY_DRIVER ?= x11
#------------------------------------------------------------------------------
# Compiler configuration:
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For UNIX-like platforms:
# Uncomment TSYS_POSIX if your platform is not listed in include/tek/config.h
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CC = $(CROSS_COMPILE)gcc -fpic # -DTSYS_POSIX
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# For Windows using MinGW:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CC = $(CROSS_COMPILE)gcc -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400
# CC += -DHAL_USE_ATOMICS # leave commented with very old versions of MinGW
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Cross compilation:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CROSS_COMPILE =
# CROSS_COMPILE = i586-mingw32-
# CROSS_COMPILE = i686-pc-mingw32-
# CROSS_COMPILE = i686-w64-mingw32-
# EXECUTE = wine
#------------------------------------------------------------------------------
# Platform libraries:
# If you link any libraries from directories not in the system run-time
# search path, you may need to uncomment the $(CC_LD_RT) flags for those
# libraries below.
#------------------------------------------------------------------------------
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# POSIX:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PLATFORM_LIBS = -pthread
CC_LD_RT = -Wl,-rpath,
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# HPPA, IA64 HPUX: Note that DLLEXT (see above) must be .sl
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# PLATFORM_LIBS = -D_POSIX_C_SOURCE=199506L -lpthread
# CC_LD_RT = -Wl,+s,+b,
# for IA64:
# CC_LD_RT = -Wl,+b,
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Solaris:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CC_LD_RT = -R
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Mac OS X: See also below MODCFLAGS, LUAEXE_DEFS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# PLATFORM_LIBS =
# CC_LD_RT = -Wl,-rpath,
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# NetBSD:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# CC_LD_RT = -Wl,-rpath=/usr/X11R7/lib:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Windows:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# PLATFORM_LIBS = -lwinmm
# LUA_LIBS = -L$(BASEDIR) -llua51 # -llua5.2
#------------------------------------------------------------------------------
# tekUI features:
# ENABLE_GRADIENT - enable color gradients
# ENABLE_PIXMAP_CACHE - enable caching of pixmaps
# ENABLE_PNG - enable PNG support through libpng
# ENABLE_FILENO - dispatches lines from a fd (normally stdin) to MSG_USER
# ENABLE_DGRAM=portnr - enables a datagram server on addr:portnr for MSG_USER
# ENABLE_DGRAM_ADDR=\"addr\" - set address to listen on (default 127.0.0.1)
# TEKlib features:
# ENABLE_LAZY_SINGLETON - multithreaded lazy creation of a TEKlib singleton,
# allowing thread rendezvous (this breaks 100% ROM-ability)
#------------------------------------------------------------------------------
TEKUI_DEFS = -DENABLE_GRADIENT -DENABLE_PIXMAP_CACHE
# TEKUI_DEFS += -DENABLE_FILENO -DENABLE_DGRAM=20000
TEKUI_LIBS =
PNG_DIR = $(PREFIX)
PNG_INCDIR = $(PNG_DIR)/include
PNG_LIBDIR = $(PNG_DIR)/lib
# TEKUI_DEFS += -DENABLE_PNG -I$(PNG_INCDIR)
# TEKUI_LIBS += -L$(PNG_LIBDIR) -lpng # $(CC_LD_RT)$(PNG_LIBDIR)
TEKLIB_DEFS = -DENABLE_LAZY_SINGLETON
#------------------------------------------------------------------------------
# Lua version, prefix, include and installation paths:
# Installation is not always required, e.g. x11 and windows can do without.
# When adjusting the Lua version, see also below for include paths
#------------------------------------------------------------------------------
PREFIX ?= /usr/local
LUAVER ?= 5.1
LUA_DIR = $(PREFIX)
LUA_INCDIR = $(LUA_DIR)/include
LUA_DEFS = -I$(LUA_INCDIR)
# other known paths - better comment out what is inappropriate:
LUA_DEFS += -I/usr/include/lua$(LUAVER)
LUA_DEFS += -I/usr/local/include/lua51
LUA_LIB = $(PREFIX)/lib/lua/$(LUAVER)
LUA_SHARE = $(PREFIX)/share/lua/$(LUAVER)
SYS_LUA_LIB = $(PREFIX)/lib/lua/$(LUAVER)
SYS_LUA_SHARE = $(PREFIX)/share/lua/$(LUAVER)
#------------------------------------------------------------------------------
# Libraries:
#------------------------------------------------------------------------------
FREETYPE_DIR = $(PREFIX)
FREETYPE_INCDIR = $(FREETYPE_DIR)/include
FREETYPE_LIBDIR = $(FREETYPE_DIR)/lib
FREETYPE_LIBS = -L$(FREETYPE_LIBDIR) -lfreetype # $(CC_LD_RT)$(FREETYPE_LIBDIR)
FREETYPE_DEFS = -I$(FREETYPE_INCDIR)/freetype2 `freetype-config --cflags`
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# X11 defines and libraries:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
X11_DIR = /usr/X11R6
X11_INCDIR = $(X11_DIR)/include
X11_LIBDIR = $(X11_DIR)/lib
X11_LIBS = -L$(X11_LIBDIR) -lX11 -lXext -lXxf86vm
X11_DEFS = -I$(X11_INCDIR) -DX11_PIXMAP_CACHE -DENABLE_XSHM # -DENABLE_XVID
# For Xft (antialiased fonts) support:
X11_LIBS += $(XFT_LIBS) $(FONTCONFIG_LIBS) $(FREETYPE_LIBS)
X11_DEFS += $(XFT_DEFS) $(FONTCONFIG_DEFS) $(FREETYPE_DEFS)
XFT_DIR = $(X11_DIR)
XFT_INCDIR = $(XFT_DIR)/include
XFT_LIBDIR = $(XFT_DIR)/lib
XFT_LIBS = -L$(XFT_LIBDIR) -lXft # $(CC_LD_RT)$(XFT_LIBDIR)
XFT_DEFS = -I$(XFT_INCDIR) -DENABLE_XFT
FONTCONFIG_DIR = $(PREFIX)
FONTCONFIG_INCDIR = $(FONTCONFIG_DIR)/include
FONTCONFIG_LIBDIR = $(FONTCONFIG_DIR)/lib
FONTCONFIG_LIBS = -L$(FONTCONFIG_LIBDIR) -lfontconfig # $(CC_LD_RT)$(FONTCONFIG_LIBDIR)
FONTCONFIG_DEFS = -I$(FONTCONFIG_INCDIR)
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Raw framebuffer: Can be visualized on a Linux framebuffer, on another
# display driver, via VNC server, or any combination thereof.
# ENABLE_LINUXFB - enable Linux framebuffer and Linux event interface
# DEF_FONTDIR - default TTF font directory
# RFBPIXFMT - enforce framebuffer pixel format
# ENABLE_WINBACKBUFFER - enable window backing store
# ENABLE_BACKBUFFER - use a global backbuffer even if not strictly required
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RAWFB_LIBS = $(FREETYPE_LIBS) $(RAWFB_SUB_LIBS) $(VNCSERVER_LIBS) $(TEKUI_LIBS)
RAWFB_DEFS = $(FREETYPE_DEFS) $(RAWFB_SUB_DEFS) $(VNCSERVER_DEFS) -DRFB_PIXMAP_CACHE
# RAWFB_DEFS += -DDEF_FONTDIR=\"$(SYS_LUA_SHARE)/tek/ui/font\"
# RAWFB_DEFS += -DRFBPIXFMT=TVPIXFMT_R5G6B5
# RAWFB_DEFS += -DENABLE_WINBACKBUFFER # -DENABLE_BACKBUFFER
# Linux framebuffer support:
RAWFB_DEFS += -DENABLE_LINUXFB
# Redirect input/output to a different display driver:
# RAWFB_SUB_LIBS = -ldisplay_x11 $(X11_LIBS)
# RAWFB_SUB_DEFS = -DRFB_SUB_DEVICE=x11
# VNC support:
VNCSERVER_DIR = $(PREFIX)
VNCSERVER_INCDIR = $(VNCSERVER_DIR)/include
VNCSERVER_LIBDIR = $(VNCSERVER_DIR)/lib
# VNCSERVER_LIBS = -L$(VNCSERVER_LIBDIR) -lvncserver # $(CC_LD_RT)$(VNCSERVER_LIBDIR)
# VNCSERVER_DEFS = -DENABLE_VNCSERVER -I$(VNCSERVER_INCDIR) -DENABLE_VNCSERVER_COPYRECT # -DRFBPIXFMT=TVPIXFMT_0B5G5R5
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# DirectFB defines and libraries:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DIRECTFB_LIBS = `pkg-config --libs directfb`
DIRECTFB_DEFS = $(FREETYPE_DEFS) `pkg-config --cflags directfb`
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Windows defines and libraries:
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WIN_LIBS = $(PLATFORM_LIBS) -lgdi32
#------------------------------------------------------------------------------
# Build paths:
#------------------------------------------------------------------------------
BASEDIR ?= .
INCDIR = $(BASEDIR)/include
LIBDIR = $(BASEDIR)/lib/$(PLATFORM)
OBJDIR = build/$(PLATFORM)
BINDIR = $(BASEDIR)/bin
MODDIR = $(BINDIR)/mod
#------------------------------------------------------------------------------
# Compiler flags:
#------------------------------------------------------------------------------
DEBUG = -DTDEBUG=5 -g # TDEBUG: the lower, the more verbose. 5 = WARN
WARN = -Wall -Wextra -Wno-unused-parameter -Wno-unused-function -Wno-long-long -Wno-unused-value
OPT = -O2 -fno-strict-aliasing
INCL = -I. -Iinclude -I$(INCDIR)
LIBCFLAGS = $(DEBUG) $(WARN) $(OPT) $(INCL) $(EXTRADEFS) $(CPPFLAGS) $(CFLAGS)
MODCFLAGS = -shared -L $(LIBDIR) $(LDFLAGS)
# For Mac OS X:
# MODCFLAGS = -bundle -undefined dynamic_lookup -L $(LIBDIR) $(LDFLAGS)
BINCFLAGS = $(DEBUG) $(WARN) $(OPT) $(INCL) $(EXTRADEFS) $(LDFLAGS)
#------------------------------------------------------------------------------
# Build tools:
#------------------------------------------------------------------------------
AR = $(CROSS_COMPILE)ar rcu
RM = rm -f
RMDIR = rm -rf
MKDIR = mkdir -p
ECHO = echo
INSTALL_B = install
INSTALL_F = install
INSTALL_D = install -d
INSTALL_S = install -s
STRIP = $(CROSS_COMPILE)strip
#------------------------------------------------------------------------------
# Lua/tekUI standalone executable: not needed by default, only for 'make tools'
#------------------------------------------------------------------------------
# Lua distribution path:
LUADISTDIR = $(BASEDIR)/../lua-5.1.5
# Linux:
LUAEXE_DEFS = $(X11_DEFS) $(TEKUI_DEFS) -DLUA_USE_LINUX
LUAEXE_LIBS = $(X11_LIBS) -lreadline -lm -ldl -pthread
# Mac OS X:
# LUAEXE_DEFS = $(X11_DEFS) $(TEKUI_DEFS) -DLUA_USE_MACOSX
# LUAEXE_LIBS = $(X11_LIBS) -lreadline
# Windows:
# LUAEXE_DEFS = $(TEKUI_DEFS)
# LUAEXE_LIBS = $(WIN_LIBS)
# FreeBSD:
# LUAEXE_DEFS = $(X11_DEFS) $(TEKUI_DEFS) -DLUA_USE_LINUX
# LUAEXE_LIBS = -Wl,-E $(X11_LIBS) -lreadline -lm -pthread
#------------------------------------------------------------------------------
# Predefined targets:
#------------------------------------------------------------------------------
default-help:
@echo "==============================================================================="
@echo "Default build targets:"
@echo "-------------------------------------------------------------------------------"
@echo "all ..................... build everything that is needed"
@echo "libs .................... build libraries"
@echo "modules ................. build shared objects"
@echo "tools ................... build executables"
@echo "install ................. install modules globally"
@echo "clean ................... delete temporary files"
@echo "help .................... show these and all extra targets for this Makefile"
@echo "==============================================================================="
FORCE:
$(BINDIR):
-$(MKDIR) $@
$(MODDIR):
-$(MKDIR) $@
$(LIBDIR):
-$(MKDIR) $@
$(OBJDIR):
-$(MKDIR) $@