summaryrefslogblamecommitdiffstats
path: root/src/genembedc
blob: 36b9d75db6fdd6883ffec87f9f13b25e84f60d42 (plain) (tree)
1
2
3
4
5
6
7
8
9


         
                  
                  
                                  

                                        
 
            









                                 







                                 
             
                             
#!/bin/sh
set -e

: ${TOOL_CAT:=cat}
: ${TOOL_SED:=sed}
CONF=${1:-dhcpcd-definitions.conf}
CONF_SMALL=${2:-dhcpcd-definitions.conf}
C=${3:-dhcpcd-embedded.c.in}

$TOOL_CAT $C
echo "#ifdef SMALL"
$TOOL_SED \
	-e 's/#.*$//' \
	-e '/^$/d' \
	-e 's/^/"/g' \
	-e 's/$/\",/g' \
	-e 's/ [ ]*/ /g' \
	-e 's/	[	]*/ /g' \
	$CONF_SMALL
echo "#else"
$TOOL_SED \
	-e 's/#.*$//' \
	-e '/^$/d' \
	-e 's/^/"/g' \
	-e 's/$/\",/g' \
	-e 's/ [ ]*/ /g' \
	-e 's/	[	]*/ /g' \
	$CONF
echo "#endif"
printf "%s\n%s\n" "NULL" "};"