3 include $(TOPDIR
)/rules.mk
8 PKG_MD5SUM
:= dea74646b7e5c621fef7174df83c34b1
10 PKG_SOURCE_URL
:=http
://www.lua.org
/ftp
/
11 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.gz
14 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(PKG_VERSION
)
15 PKG_INSTALL_DIR
:=$(PKG_BUILD_DIR
)/ipkg-install
17 include $(TOPDIR
)/package
/rules.mk
19 $(eval
$(call PKG_template
,LIBLUA
,liblua
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
20 $(eval
$(call PKG_template
,LUA_INTERPRETER
,lua
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
21 $(eval
$(call PKG_template
,LUA_COMPILER
,luac
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
22 $(eval
$(call PKG_template
,LUA_EXAMPLES
,lua-examples
,$(PKG_VERSION
)-$(PKG_RELEASE
),$(ARCH
)))
24 $(PKG_BUILD_DIR
)/.configured
:
27 $(PKG_BUILD_DIR
)/.built
:
28 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
29 CC
="$(TARGET_CROSS)gcc" \
30 LD
="$(TARGET_CROSS)ld" \
31 AR
="$(TARGET_CROSS)ar rcu" \
32 RANLIB
="$(TARGET_CROSS)ranlib" \
34 MYCFLAGS
="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
35 MYLDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
37 # remove statically linked binaries, so that they will get linked against shlib this time
38 rm -f
$(PKG_BUILD_DIR
)/bin
/lua
{,c
}
39 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
40 CC
="$(TARGET_CROSS)gcc" \
41 LD
="$(TARGET_CROSS)ld" \
42 AR
="$(TARGET_CROSS)ar rcu" \
43 RANLIB
="$(TARGET_CROSS)ranlib" \
45 MYCFLAGS
="-I$(STAGING_DIR)/usr/include $(TARGET_CFLAGS)" \
46 MYLDFLAGS
="-L$(STAGING_DIR)/usr/lib" \
48 rm -rf
$(PKG_INSTALL_DIR
)
49 mkdir
-p
$(PKG_INSTALL_DIR
)
50 $(MAKE
) -C
$(PKG_BUILD_DIR
) \
51 INSTALL_ROOT
="$(PKG_INSTALL_DIR)/usr" \
56 install -d
-m0755
$(IDIR_LIBLUA
)/usr
/lib
57 cp
-fp
$(PKG_INSTALL_DIR
)/usr
/lib
/liblua
{,lib
}.so.
* $(IDIR_LIBLUA
)/usr
/lib
/
58 $(RSTRIP
) $(IDIR_LIBLUA
)
59 $(IPKG_BUILD
) $(IDIR_LIBLUA
) $(PACKAGE_DIR
)
61 $(IPKG_LUA_INTERPRETER
):
62 install -d
-m0755
$(IDIR_LUA_INTERPRETER
)/usr
/bin
63 cp
-fp
$(PKG_INSTALL_DIR
)/usr
/bin
/lua
$(IDIR_LUA_INTERPRETER
)/usr
/bin
/
64 $(RSTRIP
) $(IDIR_LUA_INTERPRETER
)
65 $(IPKG_BUILD
) $(IDIR_LUA_INTERPRETER
) $(PACKAGE_DIR
)
68 install -d
-m0755
$(IDIR_LUA_COMPILER
)/usr
/bin
69 cp
-fp
$(PKG_INSTALL_DIR
)/usr
/bin
/luac
$(IDIR_LUA_COMPILER
)/usr
/bin
/
70 $(RSTRIP
) $(IDIR_LUA_COMPILER
)
71 $(IPKG_BUILD
) $(IDIR_LUA_COMPILER
) $(PACKAGE_DIR
)
74 install -d
-m0755
$(IDIR_LUA_EXAMPLES
)/usr
/share
/lua
/examples
75 install -m0644
$(PKG_BUILD_DIR
)/test/*.lua \
76 $(IDIR_LUA_EXAMPLES
)/usr
/share
/lua
/examples
/
77 $(RSTRIP
) $(IDIR_LUA_EXAMPLES
)
78 $(IPKG_BUILD
) $(IDIR_LUA_EXAMPLES
) $(PACKAGE_DIR
)
80 $(STAGING_DIR
)/usr
/lib
/liblua.so
: $(PKG_BUILD_DIR
)/.built
81 mkdir
-p
$(STAGING_DIR
)/usr
/include
82 cp
-fp
$(PKG_INSTALL_DIR
)/usr
/include/lua
{,lib
}.h
$(STAGING_DIR
)/usr
/include/
83 cp
-fp
$(PKG_INSTALL_DIR
)/usr
/include/lauxlib.h
$(STAGING_DIR
)/usr
/include/
84 mkdir
-p
$(STAGING_DIR
)/usr
/lib
85 cp
-fp
$(PKG_INSTALL_DIR
)/usr
/lib
/liblua
{,lib
}.
{a
,so
*} $(STAGING_DIR
)/usr
/lib
/
88 install-dev
: $(STAGING_DIR
)/usr
/lib
/liblua.so
92 $(STAGING_DIR
)/usr
/include/lua
{,lib
}.h \
93 $(STAGING_DIR
)/usr
/include/lauxlib.h \
94 $(STAGING_DIR
)/usr
/lib
/liblua
{,lib
}.
{a
,so
*} \