summaryrefslogblamecommitdiffstats
path: root/src/genembedc
blob: 81545cd86b428b59583119520743dee50644d7a3 (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/$/\\n\"/g' \
	-e 's/ [ ]*/ /g' \
	-e 's/	[	]*/ /g' \
	$CONF_SMALL
echo "#else"
$TOOL_SED \
	-e 's/#.*$//' \
	-e '/^$/d' \
	-e 's/^/"/g' \
	-e 's/$/\\n"/g' \
	-e 's/ [ ]*/ /g' \
	-e 's/	[	]*/ /g' \
	$CONF
echo "#endif"
printf "%s\n%s\n" '"\0";'