From 15b27c94a130c82c56e7665c74a67583833d892b Mon Sep 17 00:00:00 2001 From: sjg Date: Fri, 9 Nov 2012 19:08:28 +0000 Subject: [PATCH] Add a unit-test for .ORDER --- usr.bin/make/unit-tests/Makefile | 4 +++- usr.bin/make/unit-tests/order | 20 ++++++++++++++++++++ usr.bin/make/unit-tests/test.exp | 3 +++ 3 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 usr.bin/make/unit-tests/order diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index bf4623f5b225..d48a06257261 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.34 2012/06/19 23:25:53 sjg Exp $ +# $NetBSD: Makefile,v 1.35 2012/11/09 19:08:28 sjg Exp $ # # Unit tests for make(1) # The main targets are: @@ -36,6 +36,7 @@ SUBFILES= \ modorder \ modts \ modword \ + order \ phony-end \ posix \ qequals \ @@ -48,6 +49,7 @@ SUBFILES= \ all: ${SUBFILES} flags.doterror= +flags.order=-j1 # the tests are actually done with sub-makes. .PHONY: ${SUBFILES} diff --git a/usr.bin/make/unit-tests/order b/usr.bin/make/unit-tests/order new file mode 100644 index 000000000000..175da471fe36 --- /dev/null +++ b/usr.bin/make/unit-tests/order @@ -0,0 +1,20 @@ +# $NetBSD: order,v 1.1 2012/11/09 19:08:28 sjg Exp $ + +# Test that .ORDER is handled correctly. +# The explicit dependency the.o: the.h will make us examine the.h +# the .ORDER will prevent us building it immediately, +# we should then examine the.c rather than stop. + +all: the.o + +.ORDER: the.c the.h + +the.c the.h: + @echo Making $@ + +.SUFFIXES: .o .c + +.c.o: + @echo Making $@ from $? + +the.o: the.h diff --git a/usr.bin/make/unit-tests/test.exp b/usr.bin/make/unit-tests/test.exp index 932d84e305a6..368dc3156dbb 100644 --- a/usr.bin/make/unit-tests/test.exp +++ b/usr.bin/make/unit-tests/test.exp @@ -310,6 +310,9 @@ LIST:tw:C/ /,/g="one two three four five six" LIST:tw:C/ /,/1g="one two three four five six" LIST:tw:tW:C/ /,/="one,two three four five six" LIST:tW:tw:C/ /,/="one two three four five six" +Making the.c +Making the.h +Making the.o from the.h the.c .TARGET="phony" .PREFIX="phony" .IMPSRC="" .TARGET="all" .PREFIX="all" .IMPSRC="" .TARGET="ok" .PREFIX="ok" .IMPSRC=""