Skip to contentSkip to conversation

Fix Makefile portability

PATCH In review John Levon 2 participants 2 messages Mar 12, 2009

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 Fix Makefile portability

# HG changeset patch
# User John Levon <[email protected]>
# Date 1236822392 25200
# Node ID 5c365f6d394e67d0ea5b9a30bd02fa5f1a3c0dbd # Parent 602cae863715248763cb78253eb4179908075bc5 Fix Makefile portability

head -n -1 sadly isn't portable.

xen/arch/x86/boot/build32.mk +1 -1
@@ -11,7 +11,7 @@ CFLAGS += -Werror -fno-builtin -msoft-fl
 CFLAGS += -Werror -fno-builtin -msoft-float
 
 %.S: %.bin
-	(od -v -t x $< | head -n -1 | \
+	(od -v -t x $< | awk 'NR > 1 {print s} {s=$0}' | \
 	sed 's/ /,0x/g' | sed 's/^[0-9]*,/ .long /') >$@
 
 %.bin: %.lnk
#1 lore raw

Review

Quoted 4 lines · John Levon

%.S: %.bin

(quoted diff) +1 -1
-	(od -v -t x $< | head -n -1 | \
+	(od -v -t x $< | awk 'NR > 1 {print s} {s=$0}' | \
 	sed 's/ /,0x/g' | sed 's/^[0-9]*,/ .long /') >$@

Let me try again:

Fix Makefile portability

head -n -1 sadly isn't portable.

xen/arch/x86/boot/build32.mk +1 -1
@@ -11,7 +11,7 @@ CFLAGS += -Werror -fno-builtin -msoft-fl
 CFLAGS += -Werror -fno-builtin -msoft-float
 
 %.S: %.bin
-	(od -v -t x $< | head -n -1 | \
+	(od -v -t x $< | awk 'NR > 1 {print s} {s=$$0}' | \
 	sed 's/ /,0x/g' | sed 's/^[0-9]*,/ .long /') >$@
 
 %.bin: %.lnk