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