remove libgcc hack
[openwrt.git] / package / base-files / Makefile
1 # $Id$
2
3 include $(TOPDIR)/rules.mk
4 include $(TOPDIR)/package/kernel.mk
5
6 PKG_NAME:=base-files
7 PKG_RELEASE:=8
8 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/base-files
9
10 REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
11 ifeq ($(REV),)
12 REV:=0
13 endif
14
15 include $(TOPDIR)/package/rules.mk
16
17 ifneq ($(DUMP),1)
18 TARGET:=-$(BOARD)-$(KERNEL)
19 UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version}
20 LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
21 endif
22
23 CONFIG_PACKAGE_base-files$(TARGET):=$(CONFIG_PACKAGE_base-files)
24
25 define Package/base-files$(TARGET)
26 SECTION:=base
27 CATEGORY:=Base system
28 DEFAULT:=y
29 TITLE:=OpenWrt system scripts
30 DESCRIPTION:=Base filesystem for OpenWrt
31 VERSION:=$(PKG_RELEASE)
32 endef
33
34 define Package/libgcc
35 SECTION:=libs
36 CATEGORY:=Libraries
37 DEFAULT:=y
38 TITLE:=GCC support library
39 VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
40 DESCRIPTION:=$(TITLE)
41 endef
42
43 define Package/uclibc
44 $(call Package/base-files$(TARGET))
45 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
46 TITLE:=C library
47 DESCRIPTION:=C library for embedded systems
48 endef
49
50 define Build/Prepare
51 mkdir -p $(PKG_BUILD_DIR)
52 endef
53
54
55 define Build/Compile/ar7
56 $(TARGET_CC) -o $(PKG_BUILD_DIR)/adam2patcher src/adam2patcher.c
57 endef
58
59 define Build/Compile/brcm
60 $(TARGET_CC) -o $(PKG_BUILD_DIR)/jffs2root src/jffs2root.c
61 endef
62
63 define Build/Compile
64 $(call Build/Compile/$(BOARD))
65 endef
66
67
68 define Package/base-files$(TARGET)/install-ar7
69 mkdir -p $(1)/sbin
70 $(CP) $(PKG_BUILD_DIR)/adam2patcher $(1)/sbin
71 endef
72 define Package/base-files$(TARGET)/install-brcm
73 mkdir -p $(1)/sbin
74 $(CP) $(PKG_BUILD_DIR)/jffs2root $(1)/sbin
75 endef
76
77 define Package/base-files$(TARGET)/install
78 $(call Package/base-files$(TARGET)/install-$(BOARD),$(1))
79 $(CP) ./default/* $(1)/
80 if [ -d $(BOARD)-$(KERNEL) ]; then \
81 $(CP) $(BOARD)-$(KERNEL)/* $(1)/; \
82 fi
83 $(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
84 $(SED) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf
85 mkdir -p $(1)/dev
86 mkdir -p $(1)/etc/crontabs
87 mkdir -p $(1)/jffs
88 mkdir -p $(1)/lib
89 mkdir -p $(1)/mnt
90 mkdir -p $(1)/proc
91 mkdir -p $(1)/tmp
92 mkdir -p $(1)/usr/lib
93 mkdir -p $(1)/usr/bin
94 mkdir -p $(1)/sys
95 mkdir -p $(1)/www
96 ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
97 ln -sf /proc/mounts $(1)/etc/mtab
98 rm -f $(1)/var
99 ln -sf /tmp $(1)/var
100 mkdir -p $(1)/etc
101 endef
102
103 define Package/uclibc/install
104 mkdir -p $(1)/lib
105 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
106 $(CP) $(STAGING_DIR)/lib/$$$$file.so.* $(1)/lib/; \
107 $(CP) $(STAGING_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
108 done
109 endef
110
111 define Package/libgcc/install
112 mkdir -p $(1)/lib
113 $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(1)/lib/
114 endef
115
116 $(eval $(call BuildPackage,base-files$(TARGET)))
117 $(eval $(call BuildPackage,libgcc))
118 $(eval $(call BuildPackage,uclibc))
This page took 0.045679 seconds and 5 git commands to generate.