Convenience function to find a WRegion based on type and name
[notion/jeffpc.git] / system.mk
blob4901a02370869999850d709460fa0830fe174138
1 ##
2 ## System settings
3 ##
5 ##
6 ## Installation paths
7 ##
9 # Installation path prefix. Unless you know what you're doing, the default
10 # of /usr/local is likely the correct choice.
11 #DIST: PREFIX=/usr/local
12 PREFIX=/usr/local
14 # Unless you are creating a package conforming to some OS's standards, you
15 # probably do not want to modify the following directories:
17 # Main binaries
18 BINDIR=$(PREFIX)/bin
19 # Configuration .lua files
20 ETCDIR=$(PREFIX)/etc/notion
21 # Some .lua files and ion-* shell scripts
22 SHAREDIR=$(PREFIX)/share/notion
23 # Manual pages
24 MANDIR=$(PREFIX)/share/man
25 # Some documents
26 DOCDIR=$(PREFIX)/share/doc/notion
27 # Nothing at the moment
28 INCDIR=$(PREFIX)/include/notion
29 # Nothing at the moment
30 LIBDIR=$(PREFIX)/lib
31 # Modules
32 MODULEDIR=$(LIBDIR)/notion/mod
33 # Compiled Lua source code
34 LCDIR=$(LIBDIR)/notion/lc
35 # ion-completefile (does not belong in SHAREDIR being a binary file)
36 EXTRABINDIR=$(LIBDIR)/notion/bin
37 # For notion-completeman system-wide cache
38 VARDIR=/var/cache/notion
39 # Message catalogs
40 LOCALEDIR=$(PREFIX)/share/locale
42 # Executable suffix (for Cygwin).
43 #BIN_SUFFIX = .exe
47 ## Modules
50 # Set PRELOAD_MODULES=1 if your system does not support dynamically loaded
51 # modules through 'libdl' or has non-standard naming conventions.
52 # You will likely need this option on e.g. Cygwin and Mac OS X.
53 #PRELOAD_MODULES=1
55 # Flags to link with libdl. Even if PRELOAD_MODULES=1, you may need this
56 # setting (for e.g. Lua, when not instructed by pkg-config).
57 DL_LIBS=-ldl
61 ## Lua
64 # To skip auto-detection of lua uncomment this and edit the variables below to
65 # suit your installation of lua.
66 #LUA_MANUAL=1
68 # Default to paths and names that should work for a build installed from the
69 # official Lua 5.1 source tarball.
70 LUA_DIR=/usr/local
71 LUA_LIBS=-L$(LUA_DIR)/lib -llua
72 LUA_INCLUDES = -I$(LUA_DIR)/include
73 LUA=$(LUA_DIR)/bin/lua
74 LUAC=$(LUA_DIR)/bin/luac
76 # Attempt to autodect lua using pkg-config.
78 ifndef LUA_MANUAL
80 ifeq (5.1,$(findstring 5.1,$(shell pkg-config --exists lua5.1 && pkg-config --modversion lua5.1)))
82 LUA_LIBS=`pkg-config --libs lua5.1`
83 LUA_INCLUDES=`pkg-config --cflags lua5.1`
84 LUA=`which lua5.1`
85 LUAC=`which luac5.1`
87 else ifeq (5.1,$(findstring 5.1,$(shell pkg-config --exists lua && pkg-config --modversion lua)))
89 LUA_LIBS=`pkg-config --libs lua`
90 LUA_INCLUDES=`pkg-config --cflags lua`
91 LUA=`which lua`
92 LUAC=`which luac`
94 endif # lua
96 endif # LUA_MANUAL
100 ## X libraries, includes and options
103 # Paths
104 X11_PREFIX=/usr/X11R6
105 # SunOS/Solaris
106 #X11_PREFIX=/usr/openwin
108 X11_LIBS=-L$(X11_PREFIX)/lib -lX11 -lXext
109 X11_INCLUDES=-I$(X11_PREFIX)/include
111 # XFree86 libraries up to 4.3.0 have a bug that can cause a segfault.
112 # The following setting should work around that situation.
113 DEFINES += -DCF_XFREE86_TEXTPROP_BUG_WORKAROUND
115 # Use the Xutf8 routines (XFree86 extension) instead of the Xmb routines
116 # in an UTF-8 locale. (No, you don't need this in UTF-8 locales, and
117 # most likely don't even want. It's only there because both Xmb and
118 # Xutf8 routines are broken, in different ways.)
119 #DEFINES += -DCF_DE_USE_XUTF8
121 # Remap F11 key to SunF36 and F12 to SunF37? You may want to set this
122 # on SunOS.
123 #DEFINES += -DCF_SUN_F1X_REMAP
127 ## Localisation
130 # If you're on an archaic system (such as relatively recent *BSD releases)
131 # without even dummy multibyte/widechar and localisation support, you may
132 # have to uncomment the following line:
133 #DEFINES += -DCF_NO_LOCALE -DCF_NO_GETTEXT
135 # On some other systems you may need to explicitly link against libintl.
136 #EXTRA_LIBS += -lintl
137 # You may also need to give the location of its headers. The following
138 # should work on Mac OS X (which needs the above option as well) with
139 # macports.
140 #EXTRA_INCLUDES += -I/opt/local/include
144 ## libc
147 # You may uncomment this if you know that your system C libary provides
148 # asprintf and vasprintf. (GNU libc does.) If HAS_SYSTEM_ASPRINTF is not
149 # defined, an implementation provided in libtu/sprintf_2.2/ is used.
150 #HAS_SYSTEM_ASPRINTF=1
152 # The following setting is needed with GNU libc for clock_gettime and the
153 # monotonic clock. Other systems may not need it, or may not provide a
154 # monotonic clock at all (which Ion can live with, and usually detect).
155 EXTRA_LIBS += -lrt
157 # Cygwin needs this.
158 #DEFINES += -DCF_NO_GETLOADAVG
162 # If you're using/have gcc, it is unlikely that you need to modify
163 # any of the settings below this line.
165 #####################################################################
169 ## C compiler.
172 CC=gcc
174 # Same as '-Wall -pedantic' without '-Wunused' as callbacks often
175 # have unused variables.
176 WARN= -W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
177 -Wtrigraphs -Wformat -Wchar-subscripts \
178 -Wparentheses -pedantic -Wuninitialized
180 CFLAGS=-Os $(WARN) $(DEFINES) $(INCLUDES) $(EXTRA_INCLUDES)
181 LDFLAGS=-Wl,--as-needed $(LIBS) $(EXTRA_LIBS)
182 EXPORT_DYNAMIC=-Xlinker --export-dynamic
184 # The following options are mainly for development use and can be used
185 # to check that the code seems to conform to some standards. Depending
186 # on the version and vendor of you libc, the options may or may not have
187 # expected results. If you define one of C99_SOURCE or XOPEN_SOURCE, you
188 # may also have to define the other.
190 #C89_SOURCE=-ansi
192 POSIX_SOURCE=-D_POSIX_C_SOURCE=200112L
194 # Most systems
195 #XOPEN_SOURCE=-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
196 # SunOS, (Irix)
197 #XOPEN_SOURCE=-D__EXTENSIONS__
199 #C99_SOURCE=-std=c99 -DCF_HAS_VA_COPY
201 # The -DCF_HAS_VA_COPY option should allow for some optimisations, and
202 # in some cases simply defining
203 #C99_SOURCE=-DCF_HAS_VA_COPY
204 # might allow for those optimisations to be taken without any special
205 # libc or compiler options.
209 ## make depend
212 DEPEND_FILE=.depend
213 DO_MAKE_DEPEND=$(CC) -MM $(DEFINES) $(INCLUDES) $(EXTRA_INCLUDES)
214 MAKE_DEPEND=$(DO_MAKE_DEPEND) $(SOURCES) > $(DEPEND_FILE)
218 ## AR
221 AR=ar
222 ARFLAGS=cr
223 RANLIB=ranlib
227 ## Install & strip
230 INSTALL=sh $(TOPDIR)/install-sh -c
231 INSTALL_STRIP=-s
232 INSTALLDIR=mkdir -p
234 BIN_MODE=755
235 DATA_MODE=644
237 RM=rm
241 ## Debugging
244 INSTALL_STRIP =
245 CFLAGS += -g