default: ; This is the testfile for MKE. ; ; The default command itself test that some basic functions of MKE ; works, along with some conditional processing of command files. ; ; There are a number of different tests you can perform. ; All have descriptions on how to perform them. ; ; If you just run the test, the description about the test ; will be printed. ; ; If the RUN variable is defined, the test will instead ; be run. ; ; To run a test, type MKE /MAK=TEST[/DEF=(RUN)] TESTn ; ; List of tests: ; ; Test0 - Test different variables that always should exist. ; Test1 - Test direct dependency loops ; Test2 - Test indirect dependency loops ; Test3 - Test command modifiers ; Test4 - Test temporary command files ; Test5 - Test conditional execution ; test0: .ifndef run ; Test0 - Test different variables that always should exist. ; ; Prints out a number of values. Just check that they look ; right, and you don't get any errors. .else ; Your operating system is $(OS) ($(OSID)) ; CLI is $(CLI) ; Current directory is $(CWD) ; Current UIC is $(UIC) ; Protection UIC is $(DUIC) .if $(osid) == 6 ; SYSUIC: $(SYSUIC) ; LIBUIC: $(LIBUIC) ; NETUIC: $(NETUIC) ; System name: $(SYSNAM) .endif ; ; Target is $@ ; Short target is $. ; Sources are $> ; First source is $< ; Changed sources are $? ; ; Sources separated by comma: {$>} ; Sources with suffix: {$(>:/FOO)} test0: test01 test.mke makefile. test01: test.mke: makefile.: .endif test1: .ifndef run ; Test1 - Test direct dependency loops ; ; When run, MKE should abort while reading the makefile, claiming ; that FOO depends on FOO. .else .if make(test1) foo: foo .endif .endif test2: .ifndef run ; Test2 - Test indirect dependency loops ; ; When run, MKE should abort with a loop detected during build. .else test2: foo foo: test2 .endif test3: .ifndef run ; Test3 - Test command modifiers ; ; When run, MKE should tell the expected result, and then ; perform the command for a number of commands. .else ; Testing to perform a line without echo. ; Doing a SET /UIC hidden... @SET /UIC ; Doing a SET /UIC protected from errors. -SET /UIC ; Doing a SET /UIC protected and hidden. @-SET /UIC ; One more -@SET /UIC ; Now try a command we know will cause an error, but ; we protect ourself. -MAC NL:=FOO.TMP;32767 ; Now we try the command without protection. ; This should terminate MKE. MAC NL:=FOO.TMP;32767 .endif test4: .ifndef run ; Test4 - Test temporary command files ; ; This will do a silly thing with IND just to check ; that we can. .else \@ ; This is echoed through IND. ^Z .endif test5: .ifndef run ; Test5 - Test conditional execution ; ; When run, this test will check that some lines ; aren't executed. .else ; This line is executed. ; Next line should also be executed: .if 1 ; This line is inside a conditional. .endif ; The next line should not be executed, and will produce ; an error, if executed... .if 0 MAC NL:=FOO.MAC;32767 .endif ; If we get here, everything works fine. .endif test6: ; A silly line. @PIP NL:=NL: .PRINT "Exit status is " $(EXSTAT) ; A silly error line. -PIP FOO.BAR;/DE .PRINT "Exit status is " $(EXSTAT) -MAC NL:=X.Z .PRINT "Exit status is " $(EXSTAT) .PRINT "_FOO is " $(_FOO) ; _FOO is $(_FOO) _FOO=kaka hex