package/uboot-envtools: remove runtime dependency of zlib
[openwrt.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 MDEPENDS:=
14 PROVIDES:=
15 EXTRA_DEPENDS:=
16 MAINTAINER:=OpenWrt Developers Team <openwrt-devel@openwrt.org>
17 SOURCE:=$(patsubst $(TOPDIR)/%,%,$(CURDIR))
18 ifneq ($(PKG_VERSION),)
19 ifneq ($(PKG_RELEASE),)
20 VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
21 else
22 VERSION:=$(PKG_VERSION)
23 endif
24 else
25 VERSION:=$(PKG_RELEASE)
26 endif
27 ifneq ($(PKG_FLAGS),)
28 PKGFLAGS:=$(PKG_FLAGS)
29 else
30 PKGFLAGS:=
31 endif
32 ifneq ($(ARCH_PACKAGES),)
33 PKGARCH:=$(ARCH_PACKAGES)
34 else
35 PKGARCH:=$(BOARD)
36 endif
37 PRIORITY:=optional
38 DEFAULT:=
39 MENU:=
40 SUBMENU:=
41 SUBMENUDEP:=
42 TITLE:=
43 KCONFIG:=
44 BUILDONLY:=
45 HIDDEN:=
46 URL:=
47 VARIANT:=
48 endef
49
50 Build/Patch:=$(Build/Patch/Default)
51 ifneq ($(strip $(PKG_UNPACK)),)
52 define Build/Prepare/Default
53 $(SH_FUNC) $(PKG_UNPACK)
54 $(Build/Patch)
55 endef
56 endif
57
58 CONFIGURE_PREFIX:=/usr
59 CONFIGURE_ARGS = \
60 --target=$(GNU_TARGET_NAME) \
61 --host=$(GNU_TARGET_NAME) \
62 --build=$(GNU_HOST_NAME) \
63 --program-prefix="" \
64 --program-suffix="" \
65 --prefix=$(CONFIGURE_PREFIX) \
66 --exec-prefix=$(CONFIGURE_PREFIX) \
67 --bindir=$(CONFIGURE_PREFIX)/bin \
68 --sbindir=$(CONFIGURE_PREFIX)/sbin \
69 --libexecdir=$(CONFIGURE_PREFIX)/lib \
70 --sysconfdir=/etc \
71 --datadir=$(CONFIGURE_PREFIX)/share \
72 --localstatedir=/var \
73 --mandir=$(CONFIGURE_PREFIX)/man \
74 --infodir=$(CONFIGURE_PREFIX)/info \
75 $(DISABLE_NLS) \
76 $(DISABLE_LARGEFILE) \
77 $(DISABLE_IPV6)
78
79 CONFIGURE_VARS = \
80 $(TARGET_CONFIGURE_OPTS) \
81 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
82 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
83 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
84 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
85
86 CONFIGURE_PATH = .
87 CONFIGURE_CMD = ./configure
88
89 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
90
91 define Build/Configure/Default
92 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
93 if [ -x $(CONFIGURE_CMD) ]; then \
94 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
95 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
96 $(CONFIGURE_VARS) \
97 $(2) \
98 $(CONFIGURE_CMD) \
99 $(CONFIGURE_ARGS) \
100 $(1); \
101 fi; \
102 )
103 endef
104
105 MAKE_VARS = \
106 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
107 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
108 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
109
110 MAKE_FLAGS = \
111 $(TARGET_CONFIGURE_OPTS) \
112 CROSS="$(TARGET_CROSS)" \
113 ARCH="$(ARCH)"
114
115 MAKE_INSTALL_FLAGS = \
116 $(MAKE_FLAGS) \
117 DESTDIR="$(PKG_INSTALL_DIR)"
118
119 MAKE_PATH = .
120
121 define Build/Compile/Default
122 $(MAKE_VARS) \
123 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
124 $(MAKE_FLAGS) \
125 $(1);
126 endef
127
128 define Build/Install/Default
129 $(MAKE_VARS) \
130 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
131 $(MAKE_INSTALL_FLAGS) \
132 $(if $(1), $(1), install);
133 endef
134
135 define Build/Dist/Default
136 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" dist)
137 endef
138
139 define Build/DistCheck/Default
140 $(call Build/Compile/Default, DESTDIR="$(PKG_BUILD_DIR)/tmp" CC="$(TARGET_CC)" distcheck)
141 endef
This page took 0.045536 seconds and 5 git commands to generate.