diff --git a/Makefile b/Makefile index 31bebf1..6a566b3 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,8 @@ rsc: $(GEN_RSC) %.capsman.rsc: %.template.rsc contrib/template-capsman.sh contrib/template-capsman.sh $< > $@ -%.local.rsc: %.template.rsc Makefile - sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ - -e '/^# NOT \/interface\/wireless\/ #$$/,/^# NOT \/interface\/wireless\/ #$$/d' \ - -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ - < $< > $@ +%.local.rsc: %.template.rsc contrib/template-local.sh + contrib/template-local.sh $< > $@ %.wifi.rsc: %.template.rsc Makefile sed -e '/\/caps-man\//d' -e '/\/interface\/wireless\//d' -e 's|%TEMPL%|.wifi|' \ diff --git a/contrib/template-local.sh b/contrib/template-local.sh new file mode 100755 index 0000000..8212028 --- /dev/null +++ b/contrib/template-local.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +set -e + +sed -e '/\/caps-man\//d' -e '/\/interface\/wifi\//d' -e 's|%TEMPL%|.local|' \ + -e '/^# NOT \/interface\/wireless\/ #$/,/^# NOT \/interface\/wireless\/ #$/d' \ + -e '/^# !!/,/^# !!/c # !! Do not edit this file, it is generated from template!' \ + < "${1}"