source: trunk/include/host-build.mk @ 8242

Last change on this file since 8242 was 8242, checked in by nbd, 9 years ago

next round of cleanup, convert target/ - make -j works now ;)

  • Property svn:eol-style set to native
File size: 3.0 KB
Line 
1#
2# Copyright (C) 2006-2007 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(INCLUDE_DIR)/host.mk
9include $(INCLUDE_DIR)/unpack.mk
10include $(INCLUDE_DIR)/depends.mk
11
12STAMP_PREPARED:=$(PKG_BUILD_DIR)/.prepared_$(shell find ${CURDIR} $(PKG_FILE_DEPEND) $(DEP_FINDPARAMS) | md5s)
13STAMP_CONFIGURED:=$(PKG_BUILD_DIR)/.configured
14STAMP_BUILT:=$(PKG_BUILD_DIR)/.built
15override MAKEFLAGS=
16
17include $(INCLUDE_DIR)/quilt.mk
18
19Build/Patch:=$(Build/Patch/Default)
20ifneq ($(strip $(PKG_UNPACK)),)
21  define Build/Prepare/Default
22        $(PKG_UNPACK)
23        $(Build/Patch)
24  endef
25endif
26
27define Build/Prepare
28  $(call Build/Prepare/Default)
29endef
30
31define Build/Configure/Default
32        @(cd $(PKG_BUILD_DIR)/$(3); \
33        [ -x configure ] && \
34                $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/$(3)/ && \
35                $(2) \
36                CPPFLAGS="-I$(STAGING_DIR)/host/include" \
37                LDFLAGS="-L$(STAGING_DIR)/host/lib" \
38                ./configure \
39                --target=$(GNU_TARGET_NAME) \
40                --host=$(GNU_TARGET_NAME) \
41                --build=$(GNU_HOST_NAME) \
42                --program-prefix="" \
43                --program-suffix="" \
44                --prefix=/usr \
45                --exec-prefix=/usr \
46                --bindir=/usr/bin \
47                --sbindir=/usr/sbin \
48                --libexecdir=/usr/lib \
49                --sysconfdir=/etc \
50                --datadir=/usr/share \
51                --localstatedir=/var \
52                --mandir=/usr/man \
53                --infodir=/usr/info \
54                $(DISABLE_NLS) \
55                $(1); \
56                true; \
57        )
58endef
59
60define Build/Configure
61  $(call Build/Configure/Default)
62endef
63
64define Build/Compile/Default
65        $(MAKE) -C $(PKG_BUILD_DIR) $(1)
66endef
67
68define Build/Compile
69  $(call Build/Compile/Default)
70endef
71
72               
73ifneq ($(strip $(PKG_SOURCE)),)
74  download: $(DL_DIR)/$(PKG_SOURCE)
75
76  $(DL_DIR)/$(PKG_SOURCE):
77        mkdir -p $(DL_DIR)
78        $(SCRIPT_DIR)/download.pl "$(DL_DIR)" "$(PKG_SOURCE)" "$(PKG_MD5SUM)" $(PKG_SOURCE_URL)
79
80  $(STAMP_PREPARED): $(DL_DIR)/$(PKG_SOURCE)
81endif
82
83ifneq ($(CONFIG_AUTOREBUILD),)
84  define HostBuild/Autoclean
85    $(PKG_BUILD_DIR)/.dep_files: $(STAMP_PREPARED)
86    $(call rdep,${CURDIR} $(PKG_FILE_DEPEND),$(STAMP_PREPARED))
87    $(call rdep,$(PKG_BUILD_DIR),$(STAMP_BUILT),$(PKG_BUILD_DIR)/.dep_files, -and -not -path "/.*" -and -not -path "*/ipkg*")
88  endef
89endif
90
91define HostBuild
92  ifeq ($(DUMP),)
93    $(call HostBuild/Autoclean)
94  endif
95 
96  $(STAMP_PREPARED):
97        @-rm -rf $(PKG_BUILD_DIR)
98        @mkdir -p $(PKG_BUILD_DIR)
99        $(call Build/Prepare)
100        touch $$@
101
102  $(STAMP_CONFIGURED): $(STAMP_PREPARED)
103        $(call Build/Configure)
104        touch $$@
105
106  $(STAMP_BUILT): $(STAMP_CONFIGURED)
107        $(call Build/Compile)
108        @$(NO_TRACE_MAKE) $(PKG_BUILD_DIR)/.dep_files
109        touch $$@
110
111  $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed: $(STAMP_BUILT)
112        $(call Build/Install)
113        mkdir -p $$(shell dirname $$@)
114        touch $$@
115       
116  ifdef Build/Install
117    install: $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
118  endif
119
120  package-clean: FORCE
121        $(call Build/Clean)
122        $(call Build/Uninstall)
123        rm -f $(STAGING_DIR)/stampfiles/.host_$(PKG_NAME)-installed
124
125  download:
126  prepare: $(STAMP_PREPARED)
127  configure: $(STAMP_CONFIGURED)
128  compile: $(STAMP_BUILT)
129  install:
130  clean: FORCE
131        $(call Build/Clean)
132        rm -rf $(PKG_BUILD_DIR)
133
134endef
Note: See TracBrowser for help on using the repository browser.