summaryrefslogtreecommitdiff
path: root/newlib/make-library
blob: 2df9df60a2b7efeabe670027f4219a2d41f07c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

dir=`basename $PWD`

echo "srcs_$dir = ["
ls *.c | sed -e "s/^/    '/" -e "s/$/',/"
echo "]"

if [ -f `echo *.h | tr ' ' '\n' | head -1` ]; then
	echo "hdrs_$dir = ["
	ls *.h | sed -e "s/^/    '/" -e "s/$/',/"
	echo "]"
fi

echo "foreach target : targets"
echo "	value = get_variable('target_' + target)"
echo "	set_variable('lib_$dir' + target,"
echo "		static_library('$dir' + target,"
echo "			srcs_$dir",
echo "			pic: false",
echo "			include_directories: inc",
echo "			c_args: value[1]))"
echo "endforeach"