mkdeps.sh 720 Bytes
Newer Older
1
#!/bin/bash
2

Toon Stegen's avatar
Toon Stegen committed
3
if [ "$#" -eq 0 ]; then
4 5 6 7
    echo "Supply PREFIX for building pico_defines.h"
    exit 1
fi

8 9
PREFIX=$1
shift
10 11 12
echo "/* PicoTCP - Definition file - DO NOT EDIT */" >$PREFIX/include/pico_defines.h
echo "/* This file is automatically generated at compile time */" >>$PREFIX/include/pico_defines.h
echo "#ifndef PICO_DEFINES_H" >>$PREFIX/include/pico_defines.h
13 14 15
echo "#define PICO_DEFINES_H" >>$PREFIX/include/pico_defines.h
echo  >>$PREFIX/include/pico_defines.h

16
for i in $@; do
17
    if (echo $i | grep "^-D" |grep PICO_SUPPORT >/dev/null); then
18
        my_def=`echo $i |sed -e "s/-D//g"`
19
        echo "#define $my_def" >> $PREFIX/include/pico_defines.h
20 21 22
    fi
done
echo "#endif" >>$PREFIX/include/pico_defines.h