add BUILD_LOG option to let the build system log all subdir make command output to...
[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 PROVIDES:=
14 EXTRA_DEPENDS:=
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)
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 KCONFIG:=
34 BUILDONLY:=
35 URL:=
36 endef
37
38 Build/Patch:=$(Build/Patch/Default)
39 ifneq ($(strip $(PKG_UNPACK)),)
40 define Build/Prepare/Default
41 $(PKG_UNPACK)
42 $(Build/Patch)
43 endef
44 endif
45
46 CONFIGURE_PREFIX:=/usr
47 CONFIGURE_ARGS = \
48 --target=$(GNU_TARGET_NAME) \
49 --host=$(GNU_TARGET_NAME) \
50 --build=$(GNU_HOST_NAME) \
51 --program-prefix="" \
52 --program-suffix="" \
53 --prefix=$(CONFIGURE_PREFIX) \
54 --exec-prefix=$(CONFIGURE_PREFIX) \
55 --bindir=$(CONFIGURE_PREFIX)/bin \
56 --sbindir=$(CONFIGURE_PREFIX)/sbin \
57 --libexecdir=$(CONFIGURE_PREFIX)/lib \
58 --sysconfdir=/etc \
59 --datadir=$(CONFIGURE_PREFIX)/share \
60 --localstatedir=/var \
61 --mandir=$(CONFIGURE_PREFIX)/man \
62 --infodir=$(CONFIGURE_PREFIX)/info \
63 $(DISABLE_NLS)
64
65 CONFIGURE_VARS = \
66 $(TARGET_CONFIGURE_OPTS) \
67 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
68 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS)" \
69 CPPFLAGS="$(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
70 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)" \
71
72 CONFIGURE_PATH = .
73 CONFIGURE_CMD = ./configure
74
75 replace_script=$(FIND) $(1) -name $(2) | $(XARGS) chmod u+w; $(FIND) $(1) -name $(2) | $(XARGS) -n1 cp $(SCRIPT_DIR)/$(2);
76
77 define Build/Configure/Default
78 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH)/$(strip $(3)); \
79 if [ -x $(CONFIGURE_CMD) ]; then \
80 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.guess) \
81 $(call replace_script,$(PKG_BUILD_DIR)/$(3),config.sub) \
82 $(CONFIGURE_VARS) \
83 $(2) \
84 $(CONFIGURE_CMD) \
85 $(CONFIGURE_ARGS) \
86 $(1); \
87 fi; \
88 )
89 endef
90
91 MAKE_VARS = \
92 CFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
93 CXXFLAGS="$(TARGET_CFLAGS) $(EXTRA_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CPPFLAGS)" \
94 LDFLAGS="$(TARGET_LDFLAGS) $(EXTRA_LDFLAGS)"
95
96 MAKE_FLAGS = \
97 $(TARGET_CONFIGURE_OPTS) \
98 CROSS="$(TARGET_CROSS)" \
99 ARCH="$(ARCH)"
100
101 MAKE_INSTALL_FLAGS = \
102 $(MAKE_FLAGS) \
103 DESTDIR="$(PKG_INSTALL_DIR)"
104
105 MAKE_PATH = .
106
107 define Build/Compile/Default
108 $(MAKE_VARS) \
109 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
110 $(MAKE_FLAGS) \
111 $(1);
112 endef
113
114 define Build/Install/Default
115 $(MAKE_VARS) \
116 $(MAKE) -C $(PKG_BUILD_DIR)/$(MAKE_PATH) \
117 $(MAKE_INSTALL_FLAGS) \
118 $(1) install;
119 endef
This page took 0.045207 seconds and 5 git commands to generate.