source: branches/whiterussian/openwrt/package/base-files/Makefile @ 3317

Last change on this file since 3317 was 3317, checked in by mbm, 11 years ago

move S50cron's mkdir out of runtime; create the directories as part of the package

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1# $Id$
2
3include $(TOPDIR)/rules.mk
4
5PKG_NAME:=base-files
6PKG_RELEASE:=7
7PKG_BUILD_DIR:=$(BUILD_DIR)/base-files
8
9include $(TOPDIR)/package/rules.mk
10
11IDIR_BASE:=$(PKG_BUILD_DIR)/base-files
12IPKG_BASE:=$(PACKAGE_DIR)/$(PKG_NAME)_$(PKG_RELEASE)_$(ARCH).ipk
13
14LIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version}
15IDIR_LIBC:=$(PKG_BUILD_DIR)/uclibc
16IPKG_LIBC:=$(PACKAGE_DIR)/uclibc_$(LIBC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
17
18GCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
19IDIR_GCC:=$(PKG_BUILD_DIR)/libgcc
20IPKG_GCC:=$(PACKAGE_DIR)/libgcc_$(GCC_VERSION)-$(PKG_RELEASE)_$(ARCH).ipk
21
22PACKAGES:=$(IPKG_BASE) $(IPKG_LIBC) 
23PACKAGES_INSTALL:=$(IPKG_BASE) $(IPKG_LIBC) 
24
25ifeq ($(BR2_PACKAGE_LIBGCC),y)
26PACKAGES+=$(IPKG_GCC)
27PACKAGES_INSTALL+=$(IPKG_GCC)
28endif
29ifeq ($(BR2_PACKAGE_LIBGCC),m)
30PACKAGES+=$(IPKG_GCC)
31endif
32
33$(PKG_BUILD_DIR)/.prepared:
34        mkdir -p $(PKG_BUILD_DIR) $(PACKAGE_DIR)
35        touch $@
36
37$(PKG_BUILD_DIR)/.built:
38        touch $@
39
40$(IPKG_BASE):
41        $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_BASE) ipkg/$(PKG_NAME).control $(PKG_RELEASE) $(ARCH)
42        cp -a ./default/* $(IDIR_BASE)
43        mkdir -p $(IDIR_BASE)/dev
44        mkdir -p $(IDIR_BASE)/etc/crontabs
45        mkdir -p $(IDIR_BASE)/jffs
46        mkdir -p $(IDIR_BASE)/lib
47        mkdir -p $(IDIR_BASE)/mnt
48        mkdir -p $(IDIR_BASE)/proc
49        mkdir -p $(IDIR_BASE)/tmp
50        mkdir -p $(IDIR_BASE)/usr/lib
51        mkdir -p $(IDIR_BASE)/usr/bin
52        mkdir -p $(IDIR_BASE)/www
53        ln -sf /tmp/resolv.conf $(IDIR_BASE)/etc/resolv.conf
54        ln -sf /tmp $(IDIR_BASE)/var
55        -find $(IDIR_BASE) -type d -name CVS | xargs rm -rf
56        -find $(IDIR_BASE) -type d -name .svn | xargs rm -rf
57        -find $(IDIR_BASE) -name '.#*' | xargs rm -f
58        -grep \^BR2_SYSCONF $(TOPDIR)/.config > $(IDIR_BASE)/etc/sysconf
59        $(IPKG_BUILD) $(IDIR_BASE) $(PACKAGE_DIR)
60
61$(IPKG_LIBC):
62        $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_LIBC) ipkg/uclibc.control $(LIBC_VERSION)-$(PKG_RELEASE) $(ARCH)
63        mkdir -p $(IDIR_LIBC)/lib
64        for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
65                cp -fpR $(STAGING_DIR)/lib/$$file.so.* $(IDIR_LIBC)/lib/; \
66                cp -fpR $(STAGING_DIR)/lib/$$file-$(LIBC_VERSION).so $(IDIR_LIBC)/lib/; \
67        done
68        -$(STRIP) $(IDIR_LIBC)/lib/*
69        $(IPKG_BUILD) $(IDIR_LIBC) $(PACKAGE_DIR)
70
71$(IPKG_GCC):
72        $(SCRIPT_DIR)/make-ipkg-dir.sh $(IDIR_GCC) ipkg/libgcc.control $(GCC_VERSION)-$(PKG_RELEASE) $(ARCH)
73        mkdir -p $(IDIR_GCC)/lib
74        cp -fpR $(STAGING_DIR)/lib/libgcc_s.so.* $(IDIR_GCC)/lib/
75        -$(STRIP) $(IDIR_GCC)/lib/*
76        $(IPKG_BUILD) $(IDIR_GCC) $(PACKAGE_DIR)
77
78package-clean:
79        rm -f $(PACKAGES)
80clean: package-clean
81prepare:
82compile: $(PACKAGES)
83install: compile
84        mkdir -p $(TARGET_DIR)
85        $(IPKG) install $(PACKAGES_INSTALL)
Note: See TracBrowser for help on using the repository browser.