aboutsummaryrefslogtreecommitdiffstats
path: root/support/scripts/copy-to-ide
blob: 674615e286ddd46f9f0624f4fecfc2eca0d26bf6 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/sh

# This hack copies libmaple's source, linker scripts, and built
# documentation into the Maple IDE repository (which is expected as
# its first argument).

DEST=$1

DEST_REF=$DEST/build/shared/reference
DEST_CORES=$DEST/hardware/leaflabs/cores/maple
DEST_LIBS=$DEST/libraries

LMAPLE_SRC="LICENSE
    ./libmaple/*.h
    ./libmaple/*.c
    ./libmaple/*.S
    ./libmaple/usb/*.h
    ./libmaple/usb/*.c
    ./libmaple/usb/usb_lib/*.h
    ./libmaple/usb/usb_lib/*.c
    ./wirish/*.h
    ./wirish/main.cxx
    ./wirish/*.cpp
    ./wirish/comm/*.cpp
    ./wirish/comm/*.h
    ./wirish/boards/*.h
    ./wirish/boards/*.cpp
    ./support/ld/common_ram.inc
    ./support/ld/common_rom.inc
    ./support/ld/libcs3_stm32_high_density.a
    ./support/ld/libcs3_stm32_med_density.a
    ./support/ld/maple
    ./support/ld/maple_mini
    ./support/ld/maple_native
    ./support/ld/maple_RET6
    ./support/ld/names.inc"

LMAPLE_DOCS=./docs
LMAPLE_DOCS_BUILD=$LMAPLE_DOCS/build/html

echo "First make sure DEST exists: $DEST"
if !(test -d $DEST)
then
    echo "Nope! Make sure you're doing this right?"
    exit -1
fi

# source
echo Copying libmaple source
rm -rf $DEST_CORES/*.c $DEST_CORES/*.cpp $DEST_CORES/*.h $DEST_CORES/*.cxx $DEST_CORES/*.S
rm -rf $DEST_CORES/*.inc $DEST_CORES/*.a $DEST_CORES/maple $DEST_CORES/maple_* 
cp -R $LMAPLE_SRC $DEST_CORES

echo Copying over libraries
cp -R libraries/* $DEST_LIBS

# libmaple version
echo Creating libmaple-version.txt
git show-ref HEAD | cut -c 1-10 > $DEST/libmaple-version.txt

# docs
echo Deleting old reference directory contents
rm -rf $DEST_REF/*

echo Rebuilding documentation
( cd $LMAPLE_DOCS; doxygen >/dev/null 2>&1 && make clean >/dev/null 2>&1 && make html )

echo Copying over documentation
cp -R $LMAPLE_DOCS_BUILD/* $DEST_REF

echo Done.