rhel: Fix use of $< in ordinary Make rules.
authorBen Pfaff <blp@nicira.com>
Mon, 25 Jul 2011 23:15:18 +0000 (16:15 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 25 Jul 2011 23:15:18 +0000 (16:15 -0700)
POSIX only allows $< in inference rules, so avoid it for these target
rules.

Also, add a header to the generated spec files to remind developers that
they are generated.

Makefile.am
rhel/automake.mk

index 5e449d6..91218e1 100644 (file)
@@ -82,6 +82,7 @@ EXTRA_DIST += \
        soexpand.pl
 
 ro_c = echo '/* -*- mode: c; buffer-read-only: t -*- */'
+ro_shell = printf '\043 Generated automatically -- do not modify!    -*- buffer-read-only: t -*-\n'
 
 SUFFIXES += .in
 .in:
index d4d5961..34abe5b 100644 (file)
@@ -20,11 +20,13 @@ EXTRA_DIST += \
 
 
 $(srcdir)/rhel/openvswitch-kmod-rhel5.spec: rhel/openvswitch-kmod-rhel5.spec.in $(top_builddir)/config.status
-       sed -e 's,[@]VERSION[@],$(VERSION),g' < $< > $@
+       ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
+               < $(srcdir)/rhel/openvswitch-kmod-rhel5.spec.in > $@
 
 $(srcdir)/rhel/openvswitch-kmod-rhel6.spec: rhel/openvswitch-kmod-rhel6.spec.in $(top_builddir)/config.status
-
-       sed -e 's,[@]VERSION[@],$(VERSION),g' < $< > $@
+       ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
+               < $(srcdir)/rhel/openvswitch-kmod-rhel6.spec.in > $@
 
 $(srcdir)/rhel/openvswitch.spec: rhel/openvswitch.spec.in $(top_builddir)/config.status
-       sed -e 's,[@]VERSION[@],$(VERSION),g' < $< > $@
+       ($(ro_shell) && sed -e 's,[@]VERSION[@],$(VERSION),g') \
+               < $(srcdir)/rhel/openvswitch.spec.in > $@