summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/v4l/Makefile b/v4l/Makefile
index 881329d7d..a034be061 100644
--- a/v4l/Makefile
+++ b/v4l/Makefile
@@ -158,12 +158,13 @@ ifneq ($(VER),)
@echo $(VER)|perl -ne 'if (/^([0-9]*)\.([0-9])*\.([0-9]*)(.*)$$/) { printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n",$$1,$$2,$$3,$$1,$$2,$$3,$$4); };' > $(obj)/.version
else
ifneq ($(DIR),)
- @perl -e 'open IN,"<$(DIR)/Makefile"; \
+ @echo "Seeking for a version at $(DIR)/Makefile."
+ @perl -e 'open IN,"$(DIR)/Makefile"; \
while (<IN>) { \
- if (/^VERSION\s*=\s*([0-9]+)/){ $$version=$$1; next; }\
- if (/^PATCHLEVEL\s*=\s*([0-9]+)/){ $$level=$$1; next; }\
- if (/^SUBLEVEL\s*=\s*([0-9]+)/){ $$sublevel=$$1; next; }\
- if (/^EXTRAVERSION\s*=\s*([^\s]+)\n/){ $$extra=$$1; next; }\
+ if (/^VERSION\s*=\s*([0-9]+)/){ $$version=$$1; }\
+ elsif (/^PATCHLEVEL\s*=\s*([0-9]+)/){ $$level=$$1; }\
+ elsif (/^SUBLEVEL\s*=\s*([0-9]+)/){ $$sublevel=$$1; }\
+ elsif (/^EXTRAVERSION\s*=\s*([^\s]+)\n/){ $$extra=$$1; }\
}; \
printf ("VERSION=%s\nPATCHLEVEL:=%s\nSUBLEVEL:=%s\nKERNELRELEASE:=%s.%s.%s%s\n", \
$$version,$$level,$$sublevel,$$version,$$level,$$sublevel,$$extra); \