posix1.mk and suffixes.mk need to cleanup in order to achieve

repeatable results.
posix1.mk's lib.a target still looks dubious.
This commit is contained in:
sjg 2014-08-29 15:55:44 +00:00
parent 587af62e94
commit 75abee676e
4 changed files with 18 additions and 8 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.48 2014/08/24 17:17:24 apb Exp $
# $NetBSD: Makefile,v 1.49 2014/08/29 15:55:44 sjg Exp $
#
# Unit tests for make(1)
# The main targets are:
@ -66,7 +66,7 @@ all: ${OUTFILES}
CLEANFILES += *.rawout *.out *.status *.tmp *.core *.tmp
CLEANFILES += obj*.[och] lib*.a # posix1.mk
CLEANFILES += issue* # suffixes.mk
CLEANFILES += issue* .[ab]* # suffixes.mk
CLEANRECURSIVE += dir dummy # posix1.mk
clean:

View File

@ -6,7 +6,7 @@ foo baR baz, bar baz, foo bar baz, fooadd baradd bazadd
mkdir -p 'dir'
touch 'dir/obj_1.h'
mkdir -p 'dir'
printf '#include "obj_1.h"\nconst char* obj_1 = "dir/obj_1.c";' \
printf '#include "obj_1.h"\nconst char* obj_1 = "dir/obj_1.c";\n' \
>'dir/obj_1.c'
Local variables
$(@)="dir/obj_1.o" $(<)="dir/obj_1.c"
@ -90,7 +90,7 @@ ar -rcv 'lib.a' 'obj1.o'
a - obj1.o
rm -f 'obj1.o'
mkdir -p '.'
printf '#include "obj_2.h"\nconst char* obj_2 = "obj_2.c";' \
printf '#include "obj_2.h"\nconst char* obj_2 = "obj_2.c";\n' \
>'obj_2.c'
mkdir -p '.'
touch 'obj_2.h'
@ -139,7 +139,7 @@ touch 'obj3.h'
mkdir -p 'dir'
touch 'dir/dummy'
mkdir -p '.'
printf '#include "obj3.h"\nconst char* obj3 = "obj3.c";' \
printf '#include "obj3.h"\nconst char* obj3 = "obj3.c";\n' \
>'obj3.c'
Local variables
$(@)="lib.a" $(<)="obj3.c"

View File

@ -1,10 +1,15 @@
# $NetBSD: posix1.mk,v 1.1 2014/08/23 15:02:04 christos Exp $
# $NetBSD: posix1.mk,v 1.2 2014/08/29 15:55:44 sjg Exp $
# Keep the default suffixes from interfering, just in case.
.SUFFIXES:
all: line-continuations suffix-substitution localvars
# we need to clean for repeatable results
.BEGIN: clean
clean:
@rm -f lib.a dir/* dummy obj*
#
# Line continuations
#
@ -171,7 +176,7 @@ obj2.o: obj_2.c obj_2.h dir/obj_1.h
# as a bait for a regression into the forced dependencies discussed earlier.
obj1.c dir/obj_1.c obj2.c obj_2.c obj3.c:
mkdir -p '$(@D)'
printf '#include "$(@F:.c=.h)"\nconst char* $(@F:.c=) = "$(@)";' \
printf '#include "$(@F:.c=.h)"\nconst char* $(@F:.c=) = "$(@)";\n' \
>'$(@)'
dir/obj_1.h obj_2.h obj3.h dummy dir/dummy:

View File

@ -1,4 +1,4 @@
# $NetBSD: suffixes.mk,v 1.1 2014/08/23 15:05:40 christos Exp $
# $NetBSD: suffixes.mk,v 1.2 2014/08/29 15:55:44 sjg Exp $
# Issues from PR 49086
@ -46,6 +46,11 @@ all: issue10.e
# available, so they would have expanded to a null string.
all: issue11.j
# we need to clean for repeatable results
.BEGIN: clean
clean:
@rm -f issue* .[ab]*
.SUFFIXES: .a .b .c
.a .a.b .b.a: