move a stampfile to make it easier to override the patch template
[openwrt/svn-archive/archive.git] / include / package-defaults.mk
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 define Package/Default
9 CONFIGFILE:=
10 SECTION:=opt
11 CATEGORY:=Extra packages
12 DEPENDS:=
13 PROVIDES:=
14 EXTRA_DEPENDS:=
15 MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
16 SOURCE:=$(patsubst $(TOPDIR)/%,%,${shell pwd})
17 ifneq ($(PKG_VERSION),)
18 ifneq ($(PKG_RELEASE),)
19 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
20 else
21 VERSION:=$(PKG_VERSION)
22 endif
23 else
24 VERSION:=$(PKG_RELEASE)
25 endif
26 PKGARCH:=$(ARCH)
27 PRIORITY:=optional
28 DEFAULT:=
29 MENU:=
30 SUBMENU:=
31 SUBMENUDEP:=
32 TITLE:=
33 DESCRIPTION:=
34 KCONFIG:=
35 endef
36
37 Build/Patch:=$(Build/Patch/Default)
38 ifneq ($(strip $(PKG_UNPACK)),)
39 define Build/Prepare/Default
40 $(PKG_UNPACK)
41 $(Build/Patch)
42 $(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
43 endef
44 endif
45
46 CONFIGURE_ARGS = \
47 --target=$(GNU_TARGET_NAME) \
48 --host=$(GNU_TARGET_NAME) \
49 --build=$(GNU_HOST_NAME) \
50 --program-prefix="" \
51 --program-suffix="" \
52 --prefix=/usr \
53 --exec-prefix=/usr \
54 --bindir=/usr/bin \
55 --sbindir=/usr/sbin \
56 --libexecdir=/usr/lib \
57 --sysconfdir=/etc \
58 --datadir=/usr/share \
59 --localstatedir=/var \
60 --mandir=/usr/man \
61 --infodir=/usr/info \
62 $(DISABLE_NLS)
63
64 CONFIGURE_VARS = \
65 $(TARGET_CONFIGURE_OPTS) \
66 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
67 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
68 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
69 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
70 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig" \
71 PKG_CONFIG_LIBDIR="$(STAGING_DIR)/usr/lib/pkgconfig"
72
73 CONFIGURE_PATH = .
74 CONFIGURE_CMD = ./configure
75
76 define Build/Configure/Default
77 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
78 if [ -x $(CONFIGURE_CMD) ]; then \
79 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/$(3)/ && \
80 $(CONFIGURE_VARS) \
81 $(2) \
82 $(CONFIGURE_CMD) \
83 $(CONFIGURE_ARGS) \
84 $(1); \
85 fi; \
86 )
87 endef
88
89 MAKE_VARS = \
90 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
91 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
92 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
93
94 MAKE_FLAGS = \
95 $(TARGET_CONFIGURE_OPTS) \
96 CROSS="$(TARGET_CROSS)" \
97 ARCH="$(ARCH)"
98
99 MAKE_PATH = .
100
101 define Build/Compile/Default
102 $(MAKE_VARS) \
103 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
104 $(MAKE_FLAGS) \
105 $(1);
106 endef