2 # Copyright (C) 2006-2008 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 PKG_BUILD_DIR ?
= $(BUILD_DIR_HOST
)/$(PKG_NAME
)$(if
$(PKG_VERSION
),-$(PKG_VERSION
))
9 PKG_INSTALL_DIR ?
= $(PKG_BUILD_DIR
)/host-install
11 include $(INCLUDE_DIR
)/host.mk
12 include $(INCLUDE_DIR
)/unpack.mk
13 include $(INCLUDE_DIR
)/depends.mk
15 STAMP_PREPARED
=$(PKG_BUILD_DIR
)/.prepared
$(if
$(QUILT
)$(DUMP
),,$(shell $(call find_md5
,${CURDIR} $(PKG_FILE_DEPEND
),)))
16 STAMP_CONFIGURED
:=$(PKG_BUILD_DIR
)/.configured
17 STAMP_BUILT
:=$(PKG_BUILD_DIR
)/.built
18 STAMP_INSTALLED
:=$(STAGING_DIR_HOST
)/stamp
/.
$(PKG_NAME
)_installed
22 include $(INCLUDE_DIR
)/download.mk
23 include $(INCLUDE_DIR
)/quilt.mk
25 Build
/Patch
:=$(Build
/Patch
/Default
)
26 ifneq ($(strip $(PKG_UNPACK
)),)
27 define Build
/Prepare
/Default
30 $(if
$(QUILT
),touch
$(PKG_BUILD_DIR
)/.quilt_used
)
35 $(call Build
/Prepare
/Default
)
38 define Build
/Configure
/Default
39 @
(cd
$(PKG_BUILD_DIR
)/$(3); \
41 $(CP
) $(SCRIPT_DIR
)/config.
{guess
,sub
} $(PKG_BUILD_DIR
)/$(3)/ && \
43 CPPFLAGS
="$(HOST_CFLAGS)" \
44 LDFLAGS
="$(HOST_LDFLAGS)" \
47 --target
=$(GNU_HOST_NAME
) \
48 --host
=$(GNU_HOST_NAME
) \
49 --build
=$(GNU_HOST_NAME
) \
52 --prefix=$(STAGING_DIR_HOST
) \
53 --exec-prefix
=$(STAGING_DIR_HOST
) \
54 --sysconfdir
=$(STAGING_DIR_HOST
)/etc \
55 --localstatedir
=$(STAGING_DIR_HOST
)/var \
62 define Build
/Configure
63 $(call Build
/Configure
/Default
)
66 define Build
/Compile
/Default
67 $(MAKE
) -C
$(PKG_BUILD_DIR
) $(1)
71 $(call Build
/Compile
/Default
)
74 ifneq ($(if
$(QUILT
),,$(CONFIG_AUTOREBUILD
)),)
75 define HostBuild
/Autoclean
76 $(call rdep
,${CURDIR} $(PKG_FILE_DEPEND
),$(STAMP_PREPARED
))
77 $(if
$(if
$(Build
/Compile
),$(filter prepare
,$(MAKECMDGOALS
)),1),,$(call rdep
,$(PKG_BUILD_DIR
),$(STAMP_BUILT
)))
81 define Download
/default
83 URL
:=$(PKG_SOURCE_URL
)
84 PROTO
:=$(PKG_SOURCE_PROTO
)
85 SUBDIR
:=$(PKG_SOURCE_SUBDIR
)
86 VERSION
:=$(PKG_SOURCE_VERSION
)
91 $(if
$(QUILT
),$(Build
/Quilt
))
92 $(if
$(strip $(PKG_SOURCE_URL
)),$(call Download
,default
))
93 $(if
$(DUMP
),,$(call HostBuild
/Autoclean
))
96 @
-rm -rf
$(PKG_BUILD_DIR
)
97 @mkdir
-p
$(PKG_BUILD_DIR
)
101 $(STAMP_CONFIGURED
): $(STAMP_PREPARED
)
102 $(call Build
/Configure
)
105 $(STAMP_BUILT
): $(STAMP_CONFIGURED
)
106 $(call Build
/Compile
)
109 $(STAMP_INSTALLED
): $(STAMP_BUILT
)
110 $(call Build
/Install
)
111 mkdir
-p
$$(shell dirname
$$@
)
115 install: $(STAMP_INSTALLED
)
120 $(call Build
/Uninstall
)
121 rm -f
$(STAMP_INSTALLED
) $(STAMP_BUILT
)
124 prepare
: $(STAMP_PREPARED
)
125 configure
: $(STAMP_CONFIGURED
)
126 compile
: $(STAMP_BUILT
)
130 rm -rf
$(PKG_BUILD_DIR
)
This page took 0.067127 seconds and 5 git commands to generate.