crtstuff: Move 6 identical sed patterns to variable
authorJohn Marino <draco@marino.st>
Sat, 17 Mar 2012 10:45:02 +0000 (11:45 +0100)
committerJohn Marino <draco@marino.st>
Sun, 18 Mar 2012 02:11:55 +0000 (03:11 +0100)
This note.ABI-tag pattern will be changed in an upcoming commit.
Taken from: FreeBSD SVN 232832 (2012-03-11)

lib/csu/Makefile
lib/csu/i386/Makefile.csu
lib/csu/x86_64/Makefile.csu

index 723a7a4..b5a5c26 100644 (file)
@@ -1,4 +1,5 @@
 CSUDIR=        ${.CURDIR}/${MACHINE_ARCH}
+SED_FIX_NOTE= -i "" -e '/\.note\.ABI-tag/s/progbits/note/'
 
 .include "${.CURDIR}/${MACHINE_ARCH}/Makefile.csu"
 
index 6342d1c..a54a747 100644 (file)
@@ -1,4 +1,4 @@
-# $FreeBSD: src/lib/csu/i386-elf/Makefile SVN 217375 2011/01/13 dim $
+# $FreeBSD: src/lib/csu/i386-elf/Makefile SVN 232832 2012/03/11 kib $
 
 SRCS=          crti.S crtn.S
 OBJS+=         gcrt1.o crt1.o Scrt1.o
@@ -18,7 +18,7 @@ CFLAGS+=      -I${CSUDIR}/../common \
 
 gcrt1_c.s: crt1_c.c
        ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${CSUDIR}/crt1_c.c
-       sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+       sed ${SED_FIX_NOTE} ${.TARGET}
 
 gcrt1_c.o: gcrt1_c.s
        ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1_c.s
@@ -28,7 +28,7 @@ gcrt1.o: gcrt1_c.o crt1_s.o
 
 crt1_c.s: crt1_c.c
        ${CC} ${CFLAGS} -S -o ${.TARGET} ${CSUDIR}/crt1_c.c
-       sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+       sed ${SED_FIX_NOTE} ${.TARGET}
 
 crt1_c.o: crt1_c.s
        ${CC} ${CFLAGS} -c -o ${.TARGET} crt1_c.s
@@ -39,7 +39,7 @@ crt1.o:       crt1_c.o crt1_s.o
 
 Scrt1_c.s: crt1_c.c
        ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${CSUDIR}/crt1_c.c
-       sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+       sed ${SED_FIX_NOTE} ${.TARGET}
 
 Scrt1_c.o: Scrt1_c.s
        ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1_c.s
index c5b2103..6540faa 100644 (file)
@@ -1,4 +1,4 @@
-# $FreeBSD: src/lib/csu/amd64/Makefile SVN 217375 2011/01/13 dim $
+# $FreeBSD: src/lib/csu/amd64/Makefile SVN 232832 2012/03/11 kib $
 
 SRCS=          crt1.c crti.S crtn.S
 OBJS+=         Scrt1.o gcrt1.o
@@ -18,21 +18,21 @@ CFLAGS+=    -fno-omit-frame-pointer
 
 crt1.s: crt1.c
        ${CC} ${CFLAGS} -S -o ${.TARGET} ${CSUDIR}/crt1.c
-       sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+       sed ${SED_FIX_NOTE} ${.TARGET}
 
 crt1.o: crt1.s
        ${CC} ${CFLAGS} -c -o ${.TARGET} crt1.s
 
 gcrt1.s: crt1.c
        ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${CSUDIR}/crt1.c
-       sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+       sed ${SED_FIX_NOTE} ${.TARGET}
 
 gcrt1.o: gcrt1.s
        ${CC} ${CFLAGS} -c -o ${.TARGET} gcrt1.s
 
 Scrt1.s: crt1.c
        ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${CSUDIR}/crt1.c
-       sed -i "" -e '/\.note\.ABI-tag/s/progbits/note/' ${.TARGET}
+       sed ${SED_FIX_NOTE} ${.TARGET}
 
 Scrt1.o: Scrt1.s
        ${CC} ${CFLAGS} -c -o ${.TARGET} Scrt1.s