]> git.decadent.org.uk Git - ion3.git/blob - system.mk
Merge commit '20071220' into HEAD
[ion3.git] / system.mk
1 ##
2 ## System settings
3 ##
4
5 ##
6 ## Installation paths
7 ##
8
9 PREFIX=/usr/local
10
11 # For relocatable build, use the following, and start with absolute path.
12 # RELOCATABLE=1
13 # PREFIX=
14
15 # Unless you are creating a package conforming to some OS's standards, you
16 # probably do not want to modify the following directories:
17
18 # Main binaries
19 BINDIR=$(PREFIX)/bin
20 # Configuration .lua files
21 ETCDIR=$(PREFIX)/etc/ion3
22 # Some .lua files and ion-* shell scripts
23 SHAREDIR=$(PREFIX)/share/ion3
24 # Manual pages
25 MANDIR=$(PREFIX)/share/man
26 # Some documents
27 DOCDIR=$(PREFIX)/share/doc/ion3
28 # Nothing at the moment
29 INCDIR=$(PREFIX)/include/ion3
30 # Nothing at the moment
31 LIBDIR=$(PREFIX)/lib
32 # Modules
33 MODULEDIR=$(LIBDIR)/ion3/mod
34 # Compiled Lua source code
35 LCDIR=$(LIBDIR)/ion3/lc
36 # ion-completefile (does not belong in SHAREDIR being a binary file)
37 EXTRABINDIR=$(LIBDIR)/ion3/bin
38 # For ion-completeman system-wide cache
39 VARDIR=/var/cache/ion3
40 # Message catalogs
41 LOCALEDIR=$(PREFIX)/share/locale
42
43
44 ##
45 ## Modules
46 ##
47
48 # Set PRELOAD_MODULES=1 if your system does not support dynamically loaded
49 # modules through 'libdl' or has non-standard naming conventions.
50 #PRELOAD_MODULES=1
51
52 # Flags to link with libdl.
53 DL_LIBS=-ldl
54
55
56 ##
57 ## Lua
58 ##
59
60 # If you have installed Lua 5.1 from the official tarball without changing
61 # paths, this should do it.
62 LUA_DIR=/usr/local
63 LUA_LIBS = -L$(LUA_DIR)/lib -llua
64 LUA_INCLUDES = -I$(LUA_DIR)/include
65 LUA=$(LUA_DIR)/bin/lua
66 LUAC=$(LUA_DIR)/bin/luac
67
68 # If you are using the Debian packages, the following settings should be
69 # what you want.
70 #LUA_LIBS=`pkg-config --libs lua5.1`
71 #LUA_INCLUDES=`pkg-config --cflags lua5.1`
72 #LUA=/usr/bin/lua5.1
73 #LUAC=/usr/bin/luac5.1
74
75
76 ##
77 ## X libraries, includes and options
78 ##
79
80 X11_PREFIX=/usr/X11R6
81 # SunOS/Solaris
82 #X11_PREFIX=/usr/openwin
83
84 X11_LIBS=-L$(X11_PREFIX)/lib -lX11 -lXext
85 X11_INCLUDES=-I$(X11_PREFIX)/include
86
87 # XFree86 libraries up to 4.3.0 have a bug that can cause a segfault.
88 # The following setting  should  work around that situation.
89 DEFINES += -DCF_XFREE86_TEXTPROP_BUG_WORKAROUND
90
91 # Use the Xutf8 routines (XFree86 extension) instead of the Xmb routines
92 # in an UTF-8 locale. (No, you don't need this in UTF-8 locales, and 
93 # most likely don't even want. It's only there because both Xmb and 
94 # Xutf8 routines are broken, in different ways.)
95 #DEFINES += -DCF_DE_USE_XUTF8
96
97 # Remap F11 key to SunF36 and F12 to SunF37? You may want to set this
98 # on SunOS.
99 #DEFINES += -DCF_SUN_F1X_REMAP
100
101
102 ##
103 ## libc
104 ##
105
106 # You may uncomment this if you know your system has
107 # asprintf and vasprintf in the c library. (gnu libc has.)
108 # If HAS_SYSTEM_ASPRINTF is not defined, an implementation
109 # in sprintf_2.2/ is used.
110 #HAS_SYSTEM_ASPRINTF=1
111
112 # If you're on an archaic system (such as relatively recent *BSD releases)
113 # without even dummy multibyte/widechar and localisation support, you may 
114 # have to uncomment the following line:
115 #DEFINES += -DCF_NO_LOCALE -DCF_NO_GETTEXT
116
117 # On some other systems you may something like this:
118 #EXTRA_LIBS += -lintl
119 #EXTRA_INCLUDES +=
120
121 # clock_gettime for monotonic time
122 EXTRA_LIBS += -lrt
123
124
125 ##
126 ## C compiler
127 ##
128
129 CC=gcc
130
131 # Same as '-Wall -pedantic' without '-Wunused' as callbacks often
132 # have unused variables.
133 WARN=   -W -Wimplicit -Wreturn-type -Wswitch -Wcomment \
134         -Wtrigraphs -Wformat -Wchar-subscripts \
135         -Wparentheses -pedantic -Wuninitialized
136
137 CFLAGS=-Os $(WARN) $(DEFINES) $(EXTRA_INCLUDES) $(INCLUDES)
138 LDFLAGS=-Os $(EXTRA_LIBS) $(LIBS)
139 EXPORT_DYNAMIC=-Xlinker --export-dynamic
140
141 # The following options are mainly for development use and can be used
142 # to check that the code seems to conform to some standards. Depending
143 # on the version and vendor of you libc, the options may or may not have
144 # expected results. If you define one of C99_SOURCE or XOPEN_SOURCE, you
145 # may also have to define the other. 
146
147 #C89_SOURCE=-ansi
148
149 #POSIX_SOURCE=-D_POSIX_C_SOURCE=200112L
150
151 # Most systems
152 #XOPEN_SOURCE=-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
153 # SunOS, (Irix)
154 #XOPEN_SOURCE=-D__EXTENSIONS__
155
156 #C99_SOURCE=-std=c99 -DCF_HAS_VA_COPY
157
158 # The -DCF_HAS_VA_COPY option should allow for some optimisations, and 
159 # in some cases simply defining
160 #C99_SOURCE=-DCF_HAS_VA_COPY
161 # might allow for those optimisations to be taken without any  special
162 # libc or compiler options.
163
164
165 ##
166 ## make depend
167 ##
168
169 DEPEND_FILE=.depend
170 DO_MAKE_DEPEND=$(CC) -MM $(DEFINES) $(EXTRA_INCLUDES) $(INCLUDES)
171 MAKE_DEPEND=$(DO_MAKE_DEPEND) $(SOURCES) > $(DEPEND_FILE)
172
173 ##
174 ## AR
175 ##
176
177 AR=ar
178 ARFLAGS=cr
179 RANLIB=ranlib
180
181
182 ##
183 ## Install & strip
184 ##
185
186 INSTALL=sh $(TOPDIR)/install-sh -c
187 INSTALLDIR=mkdir -p
188
189 BIN_MODE=755
190 DATA_MODE=644
191
192 STRIP=strip
193
194 RM=rm