3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:= dea74646b7e5c621fef7174df83c34b1
10 PKG_SOURCE_URL
:=http
://www.lua.org
/ftp
/ \
11 http
://ftp.gwdg.de
/pub
/languages
/lua
/ \
12 http
://mirrors.dotsrc.org
/lua
/ \
13 http
://www.tecgraf.puc-rio.br
/lua
/ftp
/
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
17 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
18 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
20 include $(TOPDIR
)/package
/rules.mk
22 $(eval
$(call PKG_template
,LIBLUA
,liblua
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
23 $(eval
$(call PKG_template
,LUA
,lua
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
24 $(eval
$(call PKG_template
,LUAC
,luac
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
25 $(eval
$(call PKG_template
,LUA_EXAMPLES
,lua-examples
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
27 $(PKG_BUILD_DIR
)/.configured
:
30 $(PKG_BUILD_DIR
)/.built
: $(PKG_BUILD_DIR
)/.configured
31 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
32 CC
="$(TARGET_CROSS)gcc" \
33 LD
="$(TARGET_CROSS)ld" \
34 AR
="$(TARGET_CROSS)ar rcu" \
35 RANLIB
="$(TARGET_CROSS)ranlib" \
37 MYCFLAGS
="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
38 MYLDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
40 # remove statically linked binaries, so that they will get linked against shlib this time
41 rm -f
$(PKG_BUILD_DIR
)/bin
/lua
{,c
}
42 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
43 CC
="$(TARGET_CROSS)gcc" \
44 LD
="$(TARGET_CROSS)ld" \
45 AR
="$(TARGET_CROSS)ar rcu" \
46 RANLIB
="$(TARGET_CROSS)ranlib" \
48 MYCFLAGS
="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
49 MYLDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
51 rm -rf
$(PKG_INSTALL_DIR
)
52 mkdir
-p
$(PKG_INSTALL_DIR
)
53 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
54 INSTALL_ROOT
="$(PKG_INSTALL_DIR)/usr" \
59 install -d
-m0755
$(IDIR_LIBLUA
)/usr
/lib
60 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/lib
/liblua
{,lib
}.so.
* $(IDIR_LIBLUA
)/usr
/lib
/
61 $(RSTRIP
) $(IDIR_LIBLUA
)
62 $(IPKG_BUILD
) $(IDIR_LIBLUA
) $(PACKAGE_DIR
)
65 install -d
-m0755
$(IDIR_LUA
)/usr
/bin
66 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(IDIR_LUA
)/usr
/bin
/
68 $(IPKG_BUILD
) $(IDIR_LUA
) $(PACKAGE_DIR
)
71 install -d
-m0755
$(IDIR_LUAC
)/usr
/bin
72 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(IDIR_LUAC
)/usr
/bin
/
73 $(RSTRIP
) $(IDIR_LUAC
)
74 $(IPKG_BUILD
) $(IDIR_LUAC
) $(PACKAGE_DIR
)
77 install -d
-m0755
$(IDIR_LUA_EXAMPLES
)/usr
/share
/lua
/examples
78 install -m0644
$(PKG_BUILD_DIR
)/test/*.lua \
79 $(IDIR_LUA_EXAMPLES
)/usr
/share
/lua
/examples
/
80 $(RSTRIP
) $(IDIR_LUA_EXAMPLES
)
81 $(IPKG_BUILD
) $(IDIR_LUA_EXAMPLES
) $(PACKAGE_DIR
)
83 $(STAGING_DIR
)/usr
/lib
/liblua.so
: $(PKG_BUILD_DIR
)/.built
84 mkdir
-p
$(STAGING_DIR
)/usr
/include
85 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
}.h
$(STAGING_DIR
)/usr
/include/
86 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(STAGING_DIR
)/usr
/include/
87 mkdir
-p
$(STAGING_DIR
)/usr
/lib
88 cp
-fpR
$(PKG_INSTALL_DIR
)/usr
/lib
/liblua
{,lib
}.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
91 install-dev
: $(STAGING_DIR
)/usr
/lib
/liblua.so
95 $(STAGING_DIR
)/usr
/include/lua
{,lib
}.h \
96 $(STAGING_DIR
)/usr
/include/lauxlib.h \
97 $(STAGING_DIR
)/usr
/lib
/liblua
{,lib
}.
{a
,so
*} \
99 compile-targets
: install-dev
100 clean-targets
: uninstall-dev