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.
10 -include $(TMP_DIR
)/.packagedeps
11 $(curdir
)/builddirs
:=$(sort $(package-
) $(package-y
) $(package-m
))
13 $(curdir
)/builddirs-install
:=.
15 $(curdir
)/builddirs-default
:=.
$(sort $(package-y
) $(package-m
))
16 $(curdir
)/builddirs-prereq
:=.
$(sort $(prereq-y
) $(prereq-m
))
17 $(curdir
)/builddirs-install
:=.
$(sort $(package-y
))
19 ifneq ($(IGNORE_ERRORS
),)
20 $(curdir
)/builddirs-ignore-compile
:= $(if
$(filter m y
, $(IGNORE_ERRORS
)),$(foreach m
,$(IGNORE_ERRORS
),$(package-
$(m
))),$(package-m
))
23 $(curdir
)/install:=$(curdir
)/install-cleanup
25 $(curdir
)/cleanup
: $(TMP_DIR
)/.build
26 rm -rf
$(TARGET_DIR
) $(STAGING_DIR_ROOT
)
28 ifdef CONFIG_USE_MKLIBS
30 rm -rf
$(TMP_DIR
)/mklibs-progs
$(TMP_DIR
)/mklibs-out
31 # first find all programs and add them to the mklibs list
32 find
$(STAGING_DIR_ROOT
) -type f
-perm
+100 -exec \
33 file
-r
-N
-F
'' {} + | \
34 awk
' /executable.*dynamically/ { print $$1 }' > $(TMP_DIR
)/mklibs-progs
35 # find all loadable objects that are not regular libraries and add them to the list as well
36 find
$(STAGING_DIR_ROOT
) -type f
-name \
*.so\
* -exec \
37 file
-r
-N
-F
'' {} + | \
38 awk
' /shared object/ { print $$1 }' >> $(TMP_DIR
)/mklibs-progs
39 mkdir
-p
$(TMP_DIR
)/mklibs-out
40 $(STAGING_DIR_HOST
)/bin
/mklibs.py
-D \
41 -d
$(TMP_DIR
)/mklibs-out \
42 --sysroot
$(STAGING_DIR_ROOT
) \
45 --ldlib
$(patsubst $(STAGING_DIR_ROOT
)/%,/%,$(firstword $(wildcard \
46 $(foreach name
,ld-uClibc.so.
* ld-linux.so.
*, \
47 $(STAGING_DIR_ROOT
)/lib
/$(name
) \
49 --target
$(REAL_GNU_TARGET_NAME
) \
50 `cat $(TMP_DIR)/mklibs-progs` 2>&1
51 $(RSTRIP
) $(TMP_DIR
)/mklibs-out
52 for lib in
`ls $(TMP_DIR)/mklibs-out/*.so.* 2>/dev/null`; do \
54 DEST
="`ls "$(TARGET_DIR
)/lib
/$$LIB" "$(TARGET_DIR
)/usr
/lib
/$$LIB" 2>/dev/null`"; \
55 [ -n
"$$DEST" ] || continue
; \
56 echo
"Copying stripped library $$lib to $$DEST"; \
57 cp
"$$lib" "$$DEST" || exit
1; \
62 $(curdir
)/rootfs-prepare
: $(TMP_DIR
)/.build
63 @
-$(MAKE
) package
/preconfig
64 @if
[ -d
$(TOPDIR
)/files
]; then \
65 $(CP
) $(TOPDIR
)/files
/.
$(TARGET_DIR
); \
67 @mkdir
-p
$(TARGET_DIR
)/etc
/rc.d
70 for script in .
/etc
/init.d
/*; do \
71 grep
'#!/bin/sh /etc/rc.common' $$script >/dev
/null || continue
; \
72 IPKG_INSTROOT
=$(TARGET_DIR
) $$(which bash
) .
/etc
/rc.common
$$script enable
; \
75 @
-find
$(TARGET_DIR
) -name CVS |
$(XARGS
) rm -rf
76 @
-find
$(TARGET_DIR
) -name .svn |
$(XARGS
) rm -rf
77 @
-find
$(TARGET_DIR
) -name
'.#*' |
$(XARGS
) rm -f
78 $(if
$(CONFIG_CLEAN_IPKG
),rm -rf
$(TARGET_DIR
)/usr
/lib
/opkg
)
81 $(curdir
)/index
: FORCE
82 @
(cd
$(PACKAGE_DIR
); $(SCRIPT_DIR
)/ipkg-make-index.sh .
> Packages
&& \
83 gzip
-9c Packages
> Packages.gz \
86 $(curdir
)/flags-install
:= -j1
88 $(eval
$(call stampfile
,$(curdir
),package
,prereq
,.config
))
89 $(eval
$(call stampfile
,$(curdir
),package
,cleanup
,$(TMP_DIR
)/.build
))
90 $(eval
$(call stampfile
,$(curdir
),package
,compile
,$(TMP_DIR
)/.build
))
91 $(eval
$(call stampfile
,$(curdir
),package
,install,$(TMP_DIR
)/.build
))
92 $(eval
$(call stampfile
,$(curdir
),package
,rootfs-prepare
,$(TMP_DIR
)/.build
))
94 $(eval
$(call subdir
,$(curdir
)))
This page took 0.046936 seconds and 5 git commands to generate.