|
a/trunk/wharfie/wharfie.mk |
|
b/trunk/wharfie/wharfie.mk |
|
... |
|
... |
63 |
|
63 |
|
64 |
.PHONY: test |
64 |
.PHONY: test |
65 |
test: |
65 |
test: |
66 |
echo ${FAKEROOT} |
66 |
echo ${FAKEROOT} |
67 |
|
67 |
|
|
|
68 |
# |
|
|
69 |
# Set version specific system variables for the toolchain |
|
|
70 |
# |
|
|
71 |
debian_armhf_%.tar: gcc_postfix=-arm-none-eabi |
|
|
72 |
debian_armhf_%.tar: libc_postfix=-armhf-cross |
|
|
73 |
debian_armel_%.tar: gcc_postfix=-arm-none-eabi |
|
|
74 |
debian_armel_%.tar: libc_postfix=-armhf-cross |
|
|
75 |
debian_arm64_%.tar: gcc_postfix=-aarch64-linux-gnu |
|
|
76 |
debian_arm64_%.tar: libc_postfix=-arm64-cross |
|
|
77 |
|
|
|
78 |
# stretch changed doesn't support ARM non-eabi anymore, but has more specific ones |
|
|
79 |
debian_armhf_stretch.tar: gcc_postfix=-arm-linux-gnueabihf |
|
|
80 |
debian_armel_stretch.tar: gcc_postfix=-arm-linux-gnueabi |
|
|
81 |
|
|
|
82 |
# since stretch, ARM supports g++ |
|
|
83 |
debian_armhf_stretch.tar: additional_arch_packages+=g++-arm-linux-gnueabihf |
|
|
84 |
debian_armel_stretch.tar: additional_arch_packages+=g++-arm-linux-gnueabi |
68 |
|
85 |
|
69 |
# |
86 |
# |
70 |
# Debian / ARM Hardfloat |
87 |
# Debian / ARM Hardfloat |
71 |
# |
88 |
# |
72 |
.PHONY: debian_armhf_%.tar |
89 |
.PHONY: debian_armhf_%.tar |
|
... |
|
... |
76 |
(echo "deb http://ftp.debian.org/debian $* main"; \ |
93 |
(echo "deb http://ftp.debian.org/debian $* main"; \ |
77 |
echo "deb-src http://ftp.debian.org/debian $* main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
94 |
echo "deb-src http://ftp.debian.org/debian $* main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
78 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
95 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
79 |
${SUDO} rm -R ./$$(basename $@ .tar) |
96 |
${SUDO} rm -R ./$$(basename $@ .tar) |
80 |
echo DEBIAN_VERSION=$* > debian_version.mk |
97 |
echo DEBIAN_VERSION=$* > debian_version.mk |
81 |
echo GCC_POSTFIX=-arm-none-eabi >> debian_version.mk |
98 |
echo GCC_POSTFIX=${gcc_postfix} >> debian_version.mk |
82 |
echo LIBC_POSTFIX=-armhf-cross >> debian_version.mk |
99 |
echo LIBC_POSTFIX=${libc_postfix} >> debian_version.mk |
|
|
100 |
echo ADDITIONAL_ARCH_PACKAGES=${additional_arch_packages} >> debian_version.mk |
83 |
|
101 |
|
84 |
# |
102 |
# |
85 |
# Debian / ARM EABI |
103 |
# Debian / ARM EABI |
86 |
# |
104 |
# |
87 |
.PHONY: debian_armel_%.tar |
105 |
.PHONY: debian_armel_%.tar |
88 |
debian_armel_%.tar: |
106 |
debian_armel_%.tar: |
89 |
-mkdir ./$$(basename $@ .tar) |
107 |
-mkdir ./$$(basename $@ .tar) |
90 |
${SUDO} ${DBOOTSTRAP} --arch=armel --variant=minbase --include="${PACKAGES}" $* ./$$(basename $@ .tar) http://ftp.debian.org/debian/ |
108 |
${SUDO} ${DBOOTSTRAP} --arch=armel --variant=minbase --include="${PACKAGES}" $* ./$$(basename $@ .tar) http://ftp.debian.org/debian/ |
91 |
(echo "deb http://ftp.debian.org/debian $* main"; \ |
109 |
(echo "deb http://ftp.debian.org/debian $* main"; \ |
92 |
echo "deb-src http://ftp.debian.org/debian $* main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
110 |
echo "deb-src http://ftp.debian.org/debian $* main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
93 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
111 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
94 |
${SUDO} rm -R ./$$(basename $@ .tar) |
112 |
${SUDO} rm -R ./$$(basename $@ .tar) |
95 |
echo DEBIAN_VERSION=$* > debian_version.mk |
113 |
echo DEBIAN_VERSION=$* > debian_version.mk |
96 |
echo GCC_POSTFIX=-arm-none-eabi >> debian_version.mk |
114 |
echo GCC_POSTFIX=${gcc_postfix} >> debian_version.mk |
97 |
echo LIBC_POSTFIX=-armel-cross >> debian_version.mk |
115 |
echo LIBC_POSTFIX=${libc_postfix} >> debian_version.mk |
|
|
116 |
echo ADDITIONAL_ARCH_PACKAGES=${additional_arch_packages} >> debian_version.mk |
98 |
|
117 |
|
99 |
# |
118 |
# |
100 |
# Debian / ARM64 |
119 |
# Debian / ARM64 |
101 |
# |
120 |
# |
102 |
.PHONY: debian_armel_%.tar |
121 |
.PHONY: debian_arm64_%.tar |
103 |
debian_arm64_%.tar: |
122 |
debian_arm64_%.tar: |
104 |
-mkdir ./$$(basename $@ .tar) |
123 |
-mkdir ./$$(basename $@ .tar) |
105 |
${SUDO} ${DBOOTSTRAP} --arch=arm64 --variant=minbase --include="${PACKAGES}" $* ./$$(basename $@ .tar) http://ftp.debian.org/debian/ |
124 |
${SUDO} ${DBOOTSTRAP} --arch=arm64 --variant=minbase --include="${PACKAGES}" $* ./$$(basename $@ .tar) http://ftp.debian.org/debian/ |
106 |
(echo "deb http://ftp.debian.org/debian $* main"; \ |
125 |
(echo "deb http://ftp.debian.org/debian $* main"; \ |
107 |
echo "deb-src http://ftp.debian.org/debian $* main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
126 |
echo "deb-src http://ftp.debian.org/debian $* main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
108 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
127 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
109 |
${SUDO} rm -R ./$$(basename $@ .tar) |
128 |
${SUDO} rm -R ./$$(basename $@ .tar) |
110 |
echo DEBIAN_VERSION=$* > debian_version.mk |
129 |
echo DEBIAN_VERSION=$* > debian_version.mk |
111 |
echo GCC_POSTFIX=-aarch64-linux-gnu >> debian_version.mk |
130 |
echo GCC_POSTFIX=${gcc_postfix} >> debian_version.mk |
112 |
echo LIBC_POSTFIX=-arm64-cross >> debian_version.mk |
131 |
echo LIBC_POSTFIX=${libc_postfix} >> debian_version.mk |
|
|
132 |
echo ADDITIONAL_ARCH_PACKAGES=${additional_arch_packages} >> debian_version.mk |
113 |
|
133 |
|
114 |
# |
134 |
# |
115 |
# Debian x86/amd64... |
135 |
# Debian x86/amd64... |
116 |
# extended for debian_{amd64,i386}_{deb_version}.tar |
136 |
# extended for debian_{amd64,i386}_{deb_version}.tar |
117 |
# or old format "debian_{deb_version}.tar" |
137 |
# or old format "debian_{deb_version}.tar" |
118 |
.PHONY: debian_%.tar |
138 |
.PHONY: debian_%.tar |
119 |
debian_%.tar: |
139 |
debian_%.tar: |
120 |
$(eval ARCH:=$(if $(word 3,$(subst _, ,$@)),$(word 2,$(subst _, ,$@)),"i386")) |
140 |
$(eval ARCH:=$(if $(word 3,$(subst _, ,$@)),$(word 2,$(subst _, ,$@)),"i386")) |
121 |
$(eval VERSION:=$(if $(word 3,$(subst _, ,$@)),$(basename $(word 3,$(subst _, ,$@))),$(basename $(word 2,$(subst _, ,$@))))) |
141 |
$(eval VERSION:=$(if $(word 3,$(subst _, ,$@)),$(basename $(word 3,$(subst _, ,$@))),$(basename $(word 2,$(subst _, ,$@))))) |
122 |
-mkdir ./$$(basename $@ .tar) |
142 |
-mkdir ./$$(basename $@ .tar) |
123 |
${SUDO} ${DBOOTSTRAP} --arch=${ARCH} --variant=minbase --include="${PACKAGES}" ${VERSION} ./$$(basename $@ .tar) http://ftp.debian.org/debian/ |
143 |
${SUDO} ${DBOOTSTRAP} --arch=${ARCH} --variant=minbase --include="${PACKAGES}" ${VERSION} ./$$(basename $@ .tar) http://ftp.debian.org/debian/ |
124 |
(echo "deb http://ftp.debian.org/debian ${VERSION} main"; \ |
144 |
(echo "deb http://ftp.debian.org/debian ${VERSION} main"; \ |
125 |
echo "deb-src http://ftp.debian.org/debian ${VERSION} main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
145 |
echo "deb-src http://ftp.debian.org/debian ${VERSION} main") | ${SUDO} tee ./$$(basename $@ .tar)/etc/apt/sources.list |
126 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
146 |
cd $$(basename $@ .tar); ${SUDO} tar -cf "../$@" . |
127 |
${SUDO} rm -R ./$$(basename $@ .tar) |
147 |
${SUDO} rm -R ./$$(basename $@ .tar) |
128 |
echo DEBIAN_VERSION=${VERSION} > debian_version.mk |
148 |
echo DEBIAN_VERSION=${VERSION} > debian_version.mk |
129 |
echo GCC_POSTFIX= >> debian_version.mk |
149 |
echo GCC_POSTFIX=${gcc_postfix} >> debian_version.mk |
130 |
echo LIBC_POSTFIX= >> debian_version.mk |
150 |
echo LIBC_POSTFIX=${libc_postfix} >> debian_version.mk |
|
|
151 |
echo ADDITIONAL_ARCH_PACKAGES=${additional_arch_packages} >> debian_version.mk |
131 |
|
152 |
|
132 |
-include debian_version.mk |
153 |
-include debian_version.mk |
133 |
|
154 |
|
134 |
# |
155 |
# |
135 |
# Debian Cross-Toolchain |
156 |
# Debian Cross-Toolchain |
|
... |
|
... |
139 |
|
160 |
|
140 |
# note, this is only a sub-taget, so that we build in a subprocess, and debian_version.mk is included |
161 |
# note, this is only a sub-taget, so that we build in a subprocess, and debian_version.mk is included |
141 |
.PHONY: make_toolchain |
162 |
.PHONY: make_toolchain |
142 |
make_toolchain: |
163 |
make_toolchain: |
143 |
-mkdir ./debian_toolchain |
164 |
-mkdir ./debian_toolchain |
144 |
${SUDO} ${DBOOTSTRAP} --arch=amd64 --variant=minbase --include="${ADDITIONAL_TOOLCHAIN_PACKAGES} gcc${GCC_POSTFIX} libc6-dev${LIBC_POSTFIX}" ${DEBIAN_VERSION} ./debian_toolchain http://ftp.debian.org/debian/ |
165 |
${SUDO} ${DBOOTSTRAP} --arch=amd64 --variant=minbase --include="${ADDITIONAL_TOOLCHAIN_PACKAGES} gcc${GCC_POSTFIX} libc6-dev${LIBC_POSTFIX} ${ADDITIONAL_ARCH_PACKAGES}" ${DEBIAN_VERSION} ./debian_toolchain http://ftp.debian.org/debian/ |
145 |
${SUDO} chroot ./debian_toolchain ldconfig |
166 |
${SUDO} chroot ./debian_toolchain ldconfig |
146 |
cd debian_toolchain && ${SUDO} tar -cf "../debian_toolchain.tar" . |
167 |
cd debian_toolchain && ${SUDO} tar -cf "../debian_toolchain.tar" . |
147 |
${SUDO} rm -R ./debian_toolchain |
168 |
${SUDO} rm -R ./debian_toolchain |
148 |
|
169 |
|
149 |
# |
170 |
# |
|
... |
|
... |
210 |
@targethostname="$$(tar -O -xf ${OUTPUT_FILE} ./etc/hostname)"; \ |
231 |
@targethostname="$$(tar -O -xf ${OUTPUT_FILE} ./etc/hostname)"; \ |
211 |
printf "Hostname: %s\n" $${targethostname}; \ |
232 |
printf "Hostname: %s\n" $${targethostname}; \ |
212 |
printf "IP: %s (if target is running)\n" $$(ping -c 1 "$${targethostname}" 2>&1 | sed -n '/bytes from/ s,.*(\([^)]*\)).*,\1, p'); |
233 |
printf "IP: %s (if target is running)\n" $$(ping -c 1 "$${targethostname}" 2>&1 | sed -n '/bytes from/ s,.*(\([^)]*\)).*,\1, p'); |
213 |
|
234 |
|
214 |
clean: |
235 |
clean: |
|
|
236 |
rm -f debian_version.mk |
|
|
237 |
rm -f debian_*.tar |
215 |
rm -f *.piling.tar *.piling.tar.snar |
238 |
rm -f *.piling.tar *.piling.tar.snar |
216 |
for i in ???????.piling/; do sudo rm -Rf "./$$i"; done |
239 |
for i in ???????.piling/; do sudo rm -Rf "./$$i"; done |
217 |
for i in ????????.piling/; do sudo rm -Rf "./$$i"; done |
240 |
for i in ????????.piling/; do sudo rm -Rf "./$$i"; done |