revert to using *_ifnames internally, too many problems with firewall, ppp, etc....
[openwrt.git] / package / base-files / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10 include $(INCLUDE_DIR)/kernel.mk
11
12 PKG_NAME:=base-files
13 PKG_RELEASE:=8
14 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/base-files
15
16 REV:=$(shell LANG=C svn info | awk '/^Revision:/ { print$$2 }' )
17 ifeq ($(REV),)
18 REV:=0
19 endif
20
21 include $(INCLUDE_DIR)/package.mk
22
23 ifneq ($(DUMP),1)
24 TARGET:=-$(BOARD)-$(KERNEL)
25 UCLIBC_VERSION:=${shell cat $(STAGING_DIR)/uclibc_version 2>/dev/null}
26 LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version 2>/dev/null}
27 else
28 UCLIBC_VERSION:=<UCLIBC_VERSION>
29 LIBGCC_VERSION:=<LIBGCC_VERSION>
30 endif
31
32 CONFIG_PACKAGE_base-files$(TARGET):=$(CONFIG_PACKAGE_base-files)
33
34 define Package/base-files$(TARGET)
35 SECTION:=base
36 CATEGORY:=Base system
37 DEFAULT:=y
38 TITLE:=OpenWrt system scripts
39 DESCRIPTION:=Base filesystem for OpenWrt
40 VERSION:=$(PKG_RELEASE)-$(REV)
41 endef
42
43 define -ar7-2.4/conffiles
44 /etc/config/network
45 endef
46
47 define -aruba-2.6/conffiles
48 /etc/config/network
49 endef
50
51 define -au1000-2.6/conffiles
52 /etc/config/network
53 endef
54
55 define -rb532-2.6/conffiles
56 /etc/config/network
57 endef
58
59 define -sibyte-2.6/conffiles
60 /etc/config/network
61 endef
62
63 define -x86-2.6/conffiles
64 /etc/config/network
65 endef
66
67 define -xscale-2.6/conffiles
68 /etc/config/network
69 endef
70
71
72 define Package/base-files$(TARGET)/conffiles
73 /etc/banner
74 /etc/hosts
75 /etc/inittab
76 /etc/group
77 /etc/passwd
78 /etc/profile
79 /etc/shells
80 /etc/ipkg.conf
81 /etc/sysctl.conf
82 $(call $(TARGET)/conffiles)
83 endef
84
85 define Package/libgcc
86 SECTION:=libs
87 CATEGORY:=Libraries
88 DEFAULT:=y
89 DEPENDS:=@!NATIVE_TOOLCHAIN
90 TITLE:=GCC support library
91 VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
92 DESCRIPTION:=$(TITLE)
93 endef
94
95 define Package/libpthread
96 $(call Package/base-files$(TARGET))
97 DEFAULT:=n
98 DEPENDS:=@!NATIVE_TOOLCHAIN
99 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
100 TITLE:=POSIX thread library
101 DESCRIPTION:=POSIX thread library
102 endef
103
104
105 define Package/uclibc
106 $(call Package/base-files$(TARGET))
107 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
108 DEPENDS:=@!NATIVE_TOOLCHAIN
109 TITLE:=C library
110 DESCRIPTION:=C library for embedded systems
111 endef
112
113 define Build/Prepare
114 mkdir -p $(PKG_BUILD_DIR)
115 endef
116
117
118 define Build/Compile/ar7
119 $(TARGET_CC) -o $(PKG_BUILD_DIR)/adam2patcher src/adam2patcher.c
120 endef
121
122 define Build/Compile/brcm
123 $(TARGET_CC) -o $(PKG_BUILD_DIR)/jffs2root src/jffs2root.c
124 endef
125
126 define Build/Compile
127 $(call Build/Compile/$(BOARD))
128 endef
129
130
131 define Package/base-files$(TARGET)/install-ar7
132 mkdir -p $(1)/sbin
133 $(CP) $(PKG_BUILD_DIR)/adam2patcher $(1)/sbin
134 endef
135 define Package/base-files$(TARGET)/install-brcm
136 mkdir -p $(1)/sbin
137 $(CP) $(PKG_BUILD_DIR)/jffs2root $(1)/sbin
138 endef
139
140 define Package/base-files$(TARGET)/install
141 $(call Package/base-files$(TARGET)/install-$(BOARD),$(1))
142 $(CP) ./default/* $(1)/
143 if [ -d $(BOARD)-$(KERNEL) ]; then \
144 $(CP) $(BOARD)-$(KERNEL)/* $(1)/; \
145 fi
146 $(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
147 $(SED) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf
148 mkdir -p $(1)/dev
149 mkdir -p $(1)/etc/crontabs
150 mkdir -p $(1)/jffs
151 mkdir -p $(1)/lib
152 mkdir -p $(1)/mnt
153 mkdir -p $(1)/proc
154 mkdir -p $(1)/tmp
155 mkdir -p $(1)/usr/lib
156 mkdir -p $(1)/usr/bin
157 mkdir -p $(1)/sys
158 mkdir -p $(1)/www
159 ln -sf /proc/mounts $(1)/etc/mtab
160 rm -f $(1)/var
161 ln -sf /tmp $(1)/var
162 mkdir -p $(1)/etc
163 endef
164
165 define Package/libgcc/install
166 install -m0755 -d $(1)/lib
167 $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(1)/lib/
168 endef
169
170 define Package/libpthread/install
171 install -m0755 -d $(1)/lib
172 $(CP) $(STAGING_DIR)/lib/libpthread.so.* $(1)/lib/
173 $(CP) $(STAGING_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
174 endef
175
176 define Package/uclibc/install
177 install -m0755 -d $(1)/lib
178 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
179 $(CP) $(STAGING_DIR)/lib/$$$$file.so.* $(1)/lib/; \
180 $(CP) $(STAGING_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
181 done
182 endef
183
184 $(eval $(call BuildPackage,base-files$(TARGET)))
185 $(eval $(call BuildPackage,libgcc))
186 $(eval $(call BuildPackage,libpthread))
187 $(eval $(call BuildPackage,uclibc))
This page took 0.052314 seconds and 5 git commands to generate.