blob: 36b9d75db6fdd6883ffec87f9f13b25e84f60d42 (
plain) (
blame)
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
|
#!/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" "};"
|