2 # Copyright (C) 2006 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
11 CATEGORY
:=Extra packages
15 MAINTAINER
:=OpenWrt Developers Team
<openwrt-devel@openwrt.org
>
16 SOURCE
:=$(patsubst $(TOPDIR
)/%,%,$(CURDIR
))
17 ifneq ($(PKG_VERSION
),)
18 ifneq ($(PKG_RELEASE
),)
19 VERSION
:=$(PKG_VERSION
)-$(PKG_RELEASE
)
21 VERSION
:=$(PKG_VERSION
)
24 VERSION
:=$(PKG_RELEASE
)
26 ifneq ($(CONFIG_TARGET_adm5120
),y
)
29 PKGARCH
:=$(BOARD
)_
$(ARCH
)
42 Build
/Patch
:=$(Build
/Patch
/Default
)
43 ifneq ($(strip $(PKG_UNPACK
)),)
44 define Build
/Prepare
/Default
50 CONFIGURE_PREFIX
:=/usr
52 --target
=$(GNU_TARGET_NAME
) \
53 --host
=$(GNU_TARGET_NAME
) \
54 --build
=$(GNU_HOST_NAME
) \
57 --prefix=$(CONFIGURE_PREFIX
) \
58 --exec-prefix
=$(CONFIGURE_PREFIX
) \
59 --bindir=$(CONFIGURE_PREFIX
)/bin \
60 --sbindir
=$(CONFIGURE_PREFIX
)/sbin \
61 --libexecdir
=$(CONFIGURE_PREFIX
)/lib \
63 --datadir=$(CONFIGURE_PREFIX
)/share \
64 --localstatedir
=/var \
65 --mandir=$(CONFIGURE_PREFIX
)/man \
66 --infodir=$(CONFIGURE_PREFIX
)/info \
68 $(DISABLE_LARGEFILE
) \
72 $(TARGET_CONFIGURE_OPTS
) \
73 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
74 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
75 CPPFLAGS
="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
76 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
79 CONFIGURE_CMD
= .
/configure
81 replace_script
=$(FIND
) $(1) -name
$(2) |
$(XARGS
) chmod u
+w
; $(FIND
) $(1) -name
$(2) |
$(XARGS
) -n1 cp
$(SCRIPT_DIR
)/$(2);
83 define Build
/Configure
/Default
84 (cd
$(PKG_BUILD_DIR
)/$(CONFIGURE_PATH
)/$(strip $(3)); \
85 if
[ -x
$(CONFIGURE_CMD
) ]; then \
86 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.guess
) \
87 $(call replace_script
,$(PKG_BUILD_DIR
)/$(3),config.sub
) \
98 CFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
99 CXXFLAGS
="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
100 LDFLAGS
="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
103 $(TARGET_CONFIGURE_OPTS
) \
104 CROSS
="$(TARGET_CROSS)" \
107 MAKE_INSTALL_FLAGS
= \
109 DESTDIR
="$(PKG_INSTALL_DIR)"
113 define Build
/Compile
/Default
115 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
120 define Build
/Install
/Default
122 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(MAKE_PATH
) \
123 $(MAKE_INSTALL_FLAGS
) \
127 define Build
/Dist
/Default
128 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" dist)
131 define Build
/DistCheck
/Default
132 $(call Build
/Compile
/Default
, DESTDIR
="$(PKG_BUILD_DIR)/tmp" CC
="$(TARGET_CC)" distcheck
)