rebuild ipkg control files if Makefile changes
[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}
26 LIBGCC_VERSION:=${shell cat $(STAGING_DIR)/gcc_version}
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)
41 FORCEREBUILD:=y
42 endef
43
44 define -ar7-2.4/conffiles
45 /etc/config/network
46 endef
47
48 define -aruba-2.6/conffiles
49 /etc/config/network
50 endef
51
52 define -au1000-2.6/conffiles
53 /etc/config/network
54 endef
55
56 define -rb532-2.6/conffiles
57 /etc/config/network
58 endef
59
60 define -sibyte-2.6/conffiles
61 /etc/config/network
62 endef
63
64 define -x86-2.6/conffiles
65 /etc/config/network
66 endef
67
68 define -xscale-2.6/conffiles
69 /etc/config/network
70 endef
71
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:=Libraries
89 DEFAULT:=y
90 TITLE:=GCC support library
91 VERSION:=$(LIBGCC_VERSION)-$(PKG_RELEASE)
92 DESCRIPTION:=$(TITLE)
93 FORCEREBUILD:=n
94 endef
95
96 define Package/libpthread
97 $(call Package/base-files$(TARGET))
98 DEFAULT:=n
99 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
100 TITLE:=POSIX thread library
101 DESCRIPTION:=POSIX thread library
102 FORCEREBUILD:=n
103 endef
104
105
106 define Package/uclibc
107 $(call Package/base-files$(TARGET))
108 VERSION:=$(UCLIBC_VERSION)-$(PKG_RELEASE)
109 TITLE:=C library
110 DESCRIPTION:=C library for embedded systems
111 FORCEREBUILD:=n
112 endef
113
114 define Build/Prepare
115 mkdir -p $(PKG_BUILD_DIR)
116 endef
117
118
119 define Build/Compile/ar7
120 $(TARGET_CC) -o $(PKG_BUILD_DIR)/adam2patcher src/adam2patcher.c
121 endef
122
123 define Build/Compile/brcm
124 $(TARGET_CC) -o $(PKG_BUILD_DIR)/jffs2root src/jffs2root.c
125 endef
126
127 define Build/Compile
128 $(call Build/Compile/$(BOARD))
129 endef
130
131
132 define Package/base-files$(TARGET)/install-ar7
133 mkdir -p $(1)/sbin
134 $(CP) $(PKG_BUILD_DIR)/adam2patcher $(1)/sbin
135 endef
136 define Package/base-files$(TARGET)/install-brcm
137 mkdir -p $(1)/sbin
138 $(CP) $(PKG_BUILD_DIR)/jffs2root $(1)/sbin
139 endef
140
141 define Package/base-files$(TARGET)/install
142 $(call Package/base-files$(TARGET)/install-$(BOARD),$(1))
143 $(CP) ./default/* $(1)/
144 if [ -d $(BOARD)-$(KERNEL) ]; then \
145 $(CP) $(BOARD)-$(KERNEL)/* $(1)/; \
146 fi
147 $(SED) 's,$$$$R,r$(REV),g' $(1)/etc/banner
148 $(SED) 's,$$$$S,$(BOARD)-$(KERNEL),g' $(1)/etc/ipkg.conf
149 mkdir -p $(1)/dev
150 mkdir -p $(1)/etc/crontabs
151 mkdir -p $(1)/jffs
152 mkdir -p $(1)/lib
153 mkdir -p $(1)/mnt
154 mkdir -p $(1)/proc
155 mkdir -p $(1)/tmp
156 mkdir -p $(1)/usr/lib
157 mkdir -p $(1)/usr/bin
158 mkdir -p $(1)/sys
159 mkdir -p $(1)/www
160 ln -sf /tmp/resolv.conf $(1)/etc/resolv.conf
161 ln -sf /proc/mounts $(1)/etc/mtab
162 rm -f $(1)/var
163 ln -sf /tmp $(1)/var
164 mkdir -p $(1)/etc
165 endef
166
167 define Package/libgcc/install
168 install -m0755 -d $(1)/lib
169 $(CP) $(STAGING_DIR)/lib/libgcc_s.so.* $(1)/lib/
170 endef
171
172 define Package/libpthread/install
173 install -m0755 -d $(1)/lib
174 $(CP) $(STAGING_DIR)/lib/libpthread.so.* $(1)/lib/
175 $(CP) $(STAGING_DIR)/lib/libpthread-$(UCLIBC_VERSION).so $(1)/lib/
176 endef
177
178 define Package/uclibc/install
179 install -m0755 -d $(1)/lib
180 for file in ld-uClibc libc libcrypt libdl libm libnsl libresolv librt libuClibc libutil; do \
181 $(CP) $(STAGING_DIR)/lib/$$$$file.so.* $(1)/lib/; \
182 $(CP) $(STAGING_DIR)/lib/$$$$file-$(UCLIBC_VERSION).so $(1)/lib/; \
183 done
184 endef
185
186 $(eval $(call BuildPackage,base-files$(TARGET)))
187 $(eval $(call BuildPackage,libgcc))
188 $(eval $(call BuildPackage,libpthread))
189 $(eval $(call BuildPackage,uclibc))
This page took 0.046181 seconds and 5 git commands to generate.