12 # Unless you are creating a package conforming to some OS's standards, you
13 # probably do not want to modify the following directories:
17 # Configuration .lua files
18 ETCDIR
=$(PREFIX
)/etc
/libextl
19 # Some .lua files and ion-* shell scripts
20 SHAREDIR
=$(PREFIX
)/share
/libextl
22 MANDIR
=$(PREFIX
)/share
/man
24 DOCDIR
=$(PREFIX
)/share
/doc
/libextl
25 # Nothing at the moment
26 INCDIR
=$(PREFIX
)/include/libextl
27 # Nothing at the moment
30 MODULEDIR
=$(LIBDIR
)/libextl
/mod
31 # Compiled Lua source code
32 LCDIR
=$(LIBDIR
)/libextl
/lc
33 # ion-completefile (does not belong in SHAREDIR being a binary file)
34 EXTRABINDIR
=$(LIBDIR
)/libextl
/bin
35 # For ion-completeman system-wide cache
36 VARDIR
=/var
/cache
/libextl
38 LOCALEDIR
=$(PREFIX
)/share
/locale
52 # To skip auto-detection of lua uncomment this and edit the variables below to
53 # suit your installation of lua.
56 # Default to paths and names that should work for a build installed from the
57 # official Lua 5.1 source tarball.
58 LUA_DIR
=$(shell dirname
`which lua` | xargs dirname
)
59 LUA_LIBS
=-L
$(LUA_DIR
)/lib
-llua
60 LUA_INCLUDES
= -I
$(LUA_DIR
)/include
61 LUA
=$(LUA_DIR
)/bin
/lua
62 LUAC
=$(LUA_DIR
)/bin
/luac
64 # Attempt to autodect lua using pkg-config.
68 ifeq (5.2,$(findstring 5.2,$(shell pkg-config
--exists lua5.2
&& pkg-config
--modversion lua5.2
)))
70 LUA_LIBS
=`pkg-config --libs lua5.2`
71 LUA_INCLUDES
=`pkg-config --cflags lua5.2`
75 else ifeq (5.1,$(findstring 5.1,$(shell pkg-config
--exists lua5.1
&& pkg-config
--modversion lua5.1
)))
77 LUA_LIBS
=`pkg-config --libs lua5.1`
78 LUA_INCLUDES
=`pkg-config --cflags lua5.1`
82 else ifeq (5.1,$(findstring 5.1,$(shell pkg-config
--exists lua
&& pkg-config
--modversion lua
)))
84 LUA_LIBS
=`pkg-config --libs lua`
85 LUA_INCLUDES
=`pkg-config --cflags lua`
100 # Same as '-Wall -pedantic' without '-Wunused' as callbacks often
101 # have unused variables.
102 WARN
= -W
-Wimplicit
-Wreturn-type
-Wswitch
-Wcomment \
103 -Wtrigraphs
-Wformat
-Wchar-subscripts \
104 -Wparentheses
-pedantic
-Wuninitialized
106 CFLAGS
=-g
-Os
$(WARN
) $(DEFINES
) $(EXTRA_INCLUDES
) $(INCLUDES
)
107 LDFLAGS
=-g
-Os
$(EXTRA_LIBS
) $(LIBS
)
109 # The following options are mainly for development use and can be used
110 # to check that the code seems to conform to some standards. Depending
111 # on the version and vendor of you libc, the options may or may not have
112 # expected results. If you define one of C99_SOURCE or XOPEN_SOURCE, you
113 # may also have to define the other.
117 #POSIX_SOURCE=-D_POSIX_SOURCE
120 #XOPEN_SOURCE=-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
122 #XOPEN_SOURCE=-D__EXTENSIONS__
124 #C99_SOURCE=-std=c99 -DCF_HAS_VA_COPY
126 # The -DCF_HAS_VA_COPY option should allow for some optimisations, and
127 # in some cases simply defining
128 #C99_SOURCE=-DCF_HAS_VA_COPY
129 # might allow for those optimisations to be taken without any special
130 # libc or compiler options.
145 INSTALL
=sh
$(TOPDIR
)/install-sh
-c