File: Makefile.am

package info (click to toggle)
rrdtool 1.9.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,772 kB
  • sloc: ansic: 39,371; sh: 1,810; perl: 1,268; cs: 652; makefile: 573; python: 169; ruby: 61; awk: 30
file content (68 lines) | stat: -rw-r--r-- 2,251 bytes parent folder | download | duplicates (6)
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
# These files are not mentioned in any other Makefile
# compat-5.1.lua is only necessary for Lua 5.0 in distros where
# it's not already installed.
EXTRA_DIST = README test.lua.bottom compat-5.1r5/compat-5.1.lua

AUTOMAKE_OPTIONS = subdir-objects

LIB_VERSION_INFO=0:0:0

LUA                 = @LUA@
LUA_INSTALL_CMOD    = @LUA_INSTALL_CMOD@
LUA_INSTALL_LMOD    = @LUA_INSTALL_LMOD@
LUA_DEFINES         = @LUA_DEFINES@
LUA_CFLAGS          = @LUA_CFLAGS@
LUA_LFLAGS          = @LUA_LFLAGS@

CLEANFILES = rrd.o rrd.so test.lua test.rrd test.png

lualibdir=$(LUA_INSTALL_CMOD)
lualib_LTLIBRARIES = rrd.la
if LUA_NEED_OUR_COMPAT51
  rrd_la_SOURCES = rrdlua.c compat-5.1r5/compat-5.1.c compat-5.1r5/compat-5.1.h
  compatdir = $(LUA_INSTALL_LMOD)
  compat_DATA = compat-5.1r5/compat-5.1.lua
else
  rrd_la_SOURCES = rrdlua.c
endif
rrd_la_LIBADD = -lrrd -lm
rrd_la_LDFLAGS = -module -version-info $(LIB_VERSION_INFO) $(LUA_LFLAGS) -L$(top_builddir)/src/.libs
rrd_la_CFLAGS = -I$(top_srcdir)/src -I$(top_builddir)/src -I$(top_srcdir) $(LUA_CFLAGS) $(LUA_DEFINES) -DLIB_VERSION=\"$(LIB_VERSION)\"

.PHONY: test.lua

test.lua: test.lua.bottom
	@echo "-- Created by Makefile." > test.lua
	@echo "-- Test script adapted from the one in the Ruby binding." > test.lua
	@echo >> test.lua
if LUA50
	@echo "--- compat-5.1.lua is only required for Lua 5.0 ----------" >> test.lua
if LUA_NEED_OUR_COMPAT51
if !LUA_SITE_LINSTALL
	@echo "original_LUA_PATH = LUA_PATH" >> test.lua
	@echo "-- try only compat-5.1.lua installed with RRDtool" >> test.lua
	@echo "LUA_PATH = '$(LUA_INSTALL_LMOD)/?.lua'" >> test.lua
endif
endif
	@echo "local r = pcall(require, 'compat-5.1')" >> test.lua
	@echo "if not r then" >> test.lua
	@echo "  print('** compat-5.1.lua not found')" >> test.lua
	@echo "  os.exit(1)" >> test.lua
	@echo "end" >> test.lua
if LUA_NEED_OUR_COMPAT51
if !LUA_SITE_LINSTALL
	@echo "LUA_PATH = original_LUA_PATH" >> test.lua
	@echo "original_LUA_PATH = nil" >> test.lua
endif
endif
	@echo "----------------------------------------------------------" >> test.lua
	@echo >> test.lua
endif
if !LUA_SITE_CINSTALL
	@echo "package.cpath = '$(LUA_INSTALL_CMOD)/?.so;' .. package.cpath" >> test.lua
endif
	@cat test.lua.bottom >> test.lua

test: test.lua
	$(LUA) test.lua