diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-05-12 15:16:58 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-05-12 15:16:58 +0200 |
commit | ed6dd45396f646522be655d9383ba5c73b7916e2 (patch) | |
tree | edf0833c648d29f6c2bf02d3fe96dfb748a92f2c | |
parent | dd2d49bae6e4d8c401bd2b05e9650087c0fbf540 (diff) | |
download | input-ed6dd45396f646522be655d9383ba5c73b7916e2.tar.gz |
don't use redirections
-rw-r--r-- | GNUmakefile | 4 | ||||
-rwxr-xr-x | lirc.sh | 16 | ||||
-rwxr-xr-x | name.sh | 2 |
3 files changed, 15 insertions, 7 deletions
diff --git a/GNUmakefile b/GNUmakefile index ae10a22..f4588f7 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -20,10 +20,10 @@ all: build build: $(TARGETS) $(HEADERS): name.sh - sh name.sh $* > $@ + sh name.sh $* lircd.conf: lirc.sh - sh lirc.sh > $@ + sh lirc.sh $@ lsinput: lsinput.o input.o input-events: input-events.o input.o @@ -1,6 +1,14 @@ #!/bin/sh -INPUT="/usr/include/linux/input.h" -cat <<EOF + +OUT="${1-lircd.conf}" + +if test -f "/usr/include/linux/input-event-codes.h" +then + INPUT="/usr/include/linux/input-event-codes.h" +else + INPUT="/usr/include/linux/input.h" +fi +cat <<EOF > "$OUT" begin remote name linux-input-layer bits 32 @@ -12,8 +20,8 @@ awk " /#define (KEY|BTN)_/ { gsub(/KEY_/,\"\",\$2); printf(\"\t\t%-20s 0x%04x\n\", \$2,0x10000+strtonum(\$3)) } -" < $INPUT -cat <<EOF +" < $INPUT >> "$OUT" +cat <<EOF >> "$OUT" end codes end remote EOF @@ -19,4 +19,4 @@ awk " } printf(\"\t[ %-16s ] = \\\"%s\\\",\n\", \$2, name); } -" < $INPUT +" < $INPUT > "${TYPE}.h" |