3 include $(TOPDIR
)/rules.mk
7 PKG_BUILD_DIR
:=$(BUILD_DIR
)/base-files
9 BOARD
:=$(shell LANG
=C grep ^BR2_LINUX_2
$(TOPDIR
)/.config|sed
-e
"s/=y//" \
10 -e
"s/.*_//"| tr
"[:upper:]" "[:lower:]")
11 KERNEL
:=$(shell LANG
=C grep ^BR2_LINUX_2
$(TOPDIR
)/.config|sed
-e
"s/=y//" \
12 -e
"s/BR2_LINUX_//" -e
"s/_BRCM//" -e
"s/_/./"| tr
"[:upper:]" "[:lower:]")
14 REV
:=$(shell LANG
=C svn
info | awk
'/^Revision:/ { print$$2 }' )
19 include $(TOPDIR
)/package
/rules.mk
21 IDIR_BASE
:=$(PKG_BUILD_DIR
)/base-files
22 IPKG_BASE
:=$(PACKAGE_DIR
)/$(PKG_NAME
)_
$(PKG_RELEASE
)_
$(ARCH
).ipk
24 UCLIBC_VERSION
:=${shell cat
$(STAGING_DIR
)/uclibc_version
}
25 IDIR_UCLIBC
:=$(PKG_BUILD_DIR
)/uclibc
26 IPKG_UCLIBC
:=$(PACKAGE_DIR
)/uclibc_
$(UCLIBC_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
28 LIBGCC_VERSION
:=${shell cat
$(STAGING_DIR
)/gcc_version
}
29 IDIR_LIBGCC
:=$(PKG_BUILD_DIR
)/libgcc
30 IPKG_LIBGCC
:=$(PACKAGE_DIR
)/libgcc_
$(LIBGCC_VERSION
)-$(PKG_RELEASE
)_
$(ARCH
).ipk
32 PACKAGES
:=$(IPKG_BASE
) $(IPKG_UCLIBC
)
33 PACKAGES_INSTALL
:=$(IPKG_BASE
) $(IPKG_UCLIBC
)
35 ifeq ($(BR2_PACKAGE_LIBGCC
),y
)
36 PACKAGES_INSTALL
+=$(IPKG_LIBGCC
)
38 ifeq ($(BR2_PACKAGE_LIBGCC
),m
)
39 PACKAGES
+=$(IPKG_LIBGCC
)
42 $(PKG_BUILD_DIR
)/.prepared
:
43 mkdir
-p
$(PKG_BUILD_DIR
) $(PACKAGE_DIR
)
46 $(PKG_BUILD_DIR
)/.configured
:
49 $(PKG_BUILD_DIR
)/.built
:
53 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(IDIR_BASE
) ipkg
/$(PKG_NAME
).control
$(PKG_RELEASE
) $(ARCH
)
54 cp
-a .
/default
/* $(IDIR_BASE
)
55 $(SED
) 's,$$R,r$(REV),g' $(IDIR_BASE
)/etc
/banner
56 $(SED
) 's,$$S,$(BOARD)-$(KERNEL),g' $(IDIR_BASE
)/etc
/ipkg.conf
57 mkdir
-p
$(IDIR_BASE
)/jffs
58 mkdir
-p
$(IDIR_BASE
)/dev
59 mkdir
-p
$(IDIR_BASE
)/proc
60 mkdir
-p
$(IDIR_BASE
)/tmp
61 mkdir
-p
$(IDIR_BASE
)/lib
62 mkdir
-p
$(IDIR_BASE
)/usr
/lib
63 mkdir
-p
$(IDIR_BASE
)/usr
/bin
64 ln
-sf
/tmp
/resolv.conf
$(IDIR_BASE
)/etc
/resolv.conf
65 rm -rf
$(IDIR_BASE
)/var
66 ln
-sf
/tmp
$(IDIR_BASE
)/var
67 -find
$(IDIR_BASE
) -type d
-name CVS | xargs
rm -rf
68 -find
$(IDIR_BASE
) -type d
-name .svn | xargs
rm -rf
69 -find
$(IDIR_BASE
) -name
'.#*' | xargs
rm -f
70 mkdir
-p
$(IDIR_BASE
)/etc
71 -grep \^BR2_SYSCONF
$(TOPDIR
)/.config
> $(IDIR_BASE
)/etc
/sysconf
72 $(IPKG_BUILD
) $(IDIR_BASE
) $(PACKAGE_DIR
)
75 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(IDIR_UCLIBC
) ipkg
/uclibc.control
$(UCLIBC_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
76 mkdir
-p
$(IDIR_UCLIBC
)/lib
77 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil
; do \
78 cp
-fpR
$(STAGING_DIR
)/lib
/$$file.so.
* $(IDIR_UCLIBC
)/lib
/; \
79 cp
-fpR
$(STAGING_DIR
)/lib
/$$file-$(UCLIBC_VERSION
).so
$(IDIR_UCLIBC
)/lib
/; \
81 -$(STRIP
) $(IDIR_UCLIBC
)/lib
/*
82 $(IPKG_BUILD
) $(IDIR_UCLIBC
) $(PACKAGE_DIR
)
85 $(SCRIPT_DIR
)/make-ipkg-dir.sh
$(IDIR_LIBGCC
) ipkg
/libgcc.control
$(LIBGCC_VERSION
)-$(PKG_RELEASE
) $(ARCH
)
86 mkdir
-p
$(IDIR_LIBGCC
)/lib
87 cp
-fpR
$(STAGING_DIR
)/lib
/libgcc_s.so.
* $(IDIR_LIBGCC
)/lib
/
88 -$(STRIP
) $(IDIR_LIBGCC
)/lib
/*
89 $(IPKG_BUILD
) $(IDIR_LIBGCC
) $(PACKAGE_DIR
)
94 clean-targets
: package-clean
96 compile-targets
: $(PACKAGES
)
97 install-targets
: compile
98 mkdir
-p
$(TARGET_DIR
)
99 $(IPKG
) install $(PACKAGES_INSTALL
)