move target/default/target_skeleton into package/base-files, put all the default...
[openwrt/svn-archive/archive.git] / openwrt / package / base-files / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4
5 PKG_NAME:=base-files
6 PKG_RELEASE:=1
7
8 IDIR_BASE:=$(BUILD_DIR)/base-files
9 IPKG_BASE:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_RELEASE)_$(ARCH).ipk
10
11 LIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version}
12 IDIR_LIBC:=$(BUILD_DIR)/uclibc
13 IPKG_LIBC:=$(PACKAGE_DIR)/uclibc_$(LIBC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
14
15 GCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
16 IDIR_GCC:=$(BUILD_DIR)/libgcc
17 IPKG_GCC:=$(PACKAGE_DIR)/libgcc_$(GCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
18
19 PACKAGES:=$(IPKG_BASE) $(IPKG_LIBC) $(IPKG_GCC)
20
21 $(PACKAGE_DIR):
22 mkdir -p $(PACKAGE_DIR)
23
24 $(IPKG_BASE): $(PACKAGE_DIR)
25 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_BASE) ipkg/$(PKG_NAME).control $(PKG_RELEASE) $(ARCH)
26 cp -a ./default/* $(IDIR_BASE)
27 mkdir -p $(IDIR_BASE)/jffs
28 mkdir -p $(IDIR_BASE)/dev
29 mkdir -p $(IDIR_BASE)/proc
30 mkdir -p $(IDIR_BASE)/tmp
31 mkdir -p $(IDIR_BASE)/lib
32 mkdir -p $(IDIR_BASE)/usr/lib
33 mkdir -p $(IDIR_BASE)/usr/bin
34 ln -sf /tmp/resolv.conf $(IDIR_BASE)/etc/resolv.conf
35 rm -rf $(IDIR_BASE)/var
36 ln -sf /tmp $(IDIR_BASE)/var
37 -find $(IDIR_BASE) -type d -name CVS | xargs rm -rf
38 -find $(IDIR_BASE) -type d -name .svn | xargs rm -rf
39 mkdir -p $(IDIR_BASE)/etc
40 -grep \^BR2_SYSCONF $(TOPDIR)/.config > $(IDIR_BASE)/etc/sysconf
41 $(IPKG_BUILD) $(IDIR_BASE) $(PACKAGE_DIR)
42
43 $(IPKG_LIBC): $(PACKAGE_DIR)
44 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBC) ipkg/uclibc.control $(LIBC_VERSION)-$(PKG_RELEASE) $(ARCH)
45 mkdir -p $(IDIR_LIBC)/lib
46 cp -a $(STAGING_DIR)/lib/ld-uClibc*.so* $(IDIR_LIBC)/lib/
47 for file in c crypt dl m nsl resolv rt uClibc util; do \
48 cp -a $(STAGING_DIR)/lib/lib$$file*.so* $(IDIR_LIBC)/lib/; \
49 done
50 -$(STRIP) $(IDIR_LIBC)/lib/*
51 $(IPKG_BUILD) $(IDIR_LIBC) $(PACKAGE_DIR)
52
53 $(IPKG_GCC): $(PACKAGE_DIR)
54 $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_GCC) ipkg/libgcc.control $(GCC_VERSION)-$(PKG_RELEASE) $(ARCH)
55 mkdir -p $(IDIR_GCC)/lib
56 cp -a $(STAGING_DIR)/lib/libgcc*.so* $(IDIR_GCC)/lib/
57 -$(STRIP) $(IDIR_GCC)/lib/*
58 $(IPKG_BUILD) $(IDIR_GCC) $(PACKAGE_DIR)
59
60 prepare:
61 compile: $(PACKAGES)
62 install: compile
63 mkdir -p $(TARGET_DIR)
64 $(IPKG) install $(PACKAGES)