summaryrefslogtreecommitdiffstats
path: root/release/picobsd/build/clean
blob: 1947d71164aad637e7c81119883778695d158d4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /bin/sh -

#
# $FreeBSD$
#
set -e

# Get a list of targets.
TARGETS=""
for i in ../* ; do
    if [ -d $i -a -f $i/PICOBSD ] ; then
	TARGETS="$TARGETS `basename $i`"
    fi
done

if [ $# -lt 1 ]; then
    echo "What to clean?"
    echo "Possible targets are:${TARGETS} or 'all'"
    exit 1
fi

if [ "$1" = "all" ]; then
    list=${TARGETS}
    old="old"
else
    list=$1
    old=$1
fi
if [ -f picobsd.bin ]; then
    mv -f picobsd.bin picobsd.bin.${old}
fi

rm -f kernel kernel.gz fs.PICOBSD *.o *core *.db \
	.build.reply stage1.out build.status .image.list
cd ..
rm -rf help/tmp_hlp
echo "===================== $0 tools started ===================="
for j in $list ; do
	echo "===================== $0 $j started ======================"
	(cd ${j}/crunch1; \
	if [ -f crunch1.mk ]; then \
		make -f crunch1.mk realclean ; \
	fi ; \
	make -f ../../build/Makefile.crunch clean)
	echo "=============== $0 $j completed successfuly =============="
done
OpenPOWER on IntegriCloud