# ast nmake base rules tests
INCLUDE test.def
TEST 01 'alternate base rules'
EXEC -bcf myrules.mk
INPUT myrules.mk $'set --regress
COPY = cp
COPYFLAGS =
%.to : %.from (COPY) (COPYFLAGS)
$(COPY) $(COPYFLAGS) $(>) $(<)'
EXEC -f u1.mk
INPUT u1.mk $'rules "myrules"
all : x.to'
INPUT x.from
EXEC -f u1.mk
ERROR -
EXEC -n -f u1.mk MAKERULES=norules
ERROR -
EXEC -f u2.mk
INPUT u2.mk $'rules myrules
all : x.to'
EXEC -f u2.mk
ERROR -
EXEC -f u3.mk
INPUT u3.mk $'rules myrules
all : x.o'
INPUT x.c
ERROR - $'make: don\'t know how to make all : x.o'
EXIT 1
INPUT g1.mk $'rules myrules
COPYFLAGS = -f'
EXIT 0
ERROR -
INPUT g2.mk $'COPYFLAGS = -p'
ERROR -
INPUT g3.mk $'rules makerules
COPYFLAGS = -p'
ERROR - $'make: "g3.mk", line 1: makerules: incompatible with current base rules myrules'
EXIT 1
EXEC -c -f u4.mk
ERROR -
EXIT 0
EXEC -n -f u4.mk MAKERULES=myrules
ERROR - $'make: warning: makerules: base rules changed to myrules
make: warning: u4.mo: recompiling'
EXEC -n -f u4.mk MAKERULES=myrules.mo
EXEC -n -f u4.mk MAKERULES=$TWD/myrules.mo
EXPORT MAKERULES=myrules
EXEC -n -f u4.mk
EXPORT MAKERULES=myrules.mo
EXEC -n -f u4.mk
EXPORT MAKERULES=$TWD/myrules.mo
EXEC -n -f u4.mk