| 1 | # $Id: watcomc.mak,v 1.4 2002-06-25 01:21:19 bird Exp $
|
|---|
| 2 |
|
|---|
| 3 | #
|
|---|
| 4 | # This script contains the testcases for Doxygen version 1.2.16
|
|---|
| 5 | #
|
|---|
| 6 | # Note! We doesn't include any MAKE_INCLUDE_PROCESS file.
|
|---|
| 7 | #
|
|---|
| 8 |
|
|---|
| 9 | # Testsuite config for the process include.
|
|---|
| 10 | PATH_ROOT = ..\..
|
|---|
| 11 | TARGET_MODE = TESTCASE
|
|---|
| 12 | TARGET_NAME = watcomc
|
|---|
| 13 | MAKEFILE = $(TARGET_NAME).mak
|
|---|
| 14 |
|
|---|
| 15 | #
|
|---|
| 16 | # Check if the system includes watcom.
|
|---|
| 17 | # (We can't do these test without watcom...)
|
|---|
| 18 | #
|
|---|
| 19 | !if [$(PATH_ROOT)\tools\bin\BuildEnv.cmd watcomc11c?] == 0
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | BUILD_ENV_FORCE=WAT11C
|
|---|
| 23 | # Include the setup.mak and testsuite.tools.mk.
|
|---|
| 24 | !include $(PATH_ROOT)\$(BUILD_SETUP_MAK)
|
|---|
| 25 | !include $(PATH_MAKE)\testsuite.tools.mk
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 | # Include the process rulez.
|
|---|
| 29 | !include $(MAKE_INCLUDE_PROCESS)
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 | #
|
|---|
| 34 | # These are the files which should be installed in order to run watcomc.
|
|---|
| 35 | #
|
|---|
| 36 | WCL386 = $(WATCOM)\binnt\wcl386.exe
|
|---|
| 37 | WCC386 = $(WATCOM)\binnt\wcc386.exe
|
|---|
| 38 | WLINK = $(WATCOM)\binnt\wlink.exe
|
|---|
| 39 | WMAKE = $(WATCOM)\binnt\wmake.exe
|
|---|
| 40 |
|
|---|
| 41 | BIN_FILES = $(WCL386) $(WCC386) $(WLINK) $(WMAKE)
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 | #
|
|---|
| 45 | # Main rule, this runs all the other rulez.
|
|---|
| 46 | #
|
|---|
| 47 | testcase: $(BIN_FILES)
|
|---|
| 48 | @$(ECHO) + Running testcases for WatCom C/C++ v11.0c(beta) $(CLRRST)
|
|---|
| 49 | $(TS_EXEC_1) "wcl386 help" $(TS_EXEC_2) testcase-wcl386-help
|
|---|
| 50 | $(TS_EXEC_1) "wcc386 compile 'hello world'" $(TS_EXEC_2) testcase-compile
|
|---|
| 51 | $(TS_EXEC_1) "wcc386+wlink compile, link and run 'hello world'" $(TS_EXEC_2) testcase-helloworld
|
|---|
| 52 | $(TS_EXEC_1) "wcl386 compile and link 'hello world'" $(TS_EXEC_2) testcase-compile-and-link
|
|---|
| 53 | @$(ECHO) + Completed WatCom C/C++ v11.0c(beta)! $(CLRRST)
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | #
|
|---|
| 57 | # This testcase checks the help output.
|
|---|
| 58 | # Broken: 'press any key to continue' Doesn't detect pipe.
|
|---|
| 59 | #
|
|---|
| 60 | testcase-wcl386-help: $(PATH_TARGET)\wcl386.help.stdout
|
|---|
| 61 | SET PATH=$(WATCOM)\winnt;$(PATH)
|
|---|
| 62 | -1 $(TS_PEC) $(WCL386) > $(PATH_TARGET)\stdout 2> $(PATH_TARGET)\stderr
|
|---|
| 63 | $(TS_TEST_FILE_Z) $(PATH_TARGET)\stderr
|
|---|
| 64 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\stdout
|
|---|
| 65 | $(TS_CMP) $(PATH_TARGET)\stdout $(PATH_TARGET)\wcl386.help.stdout
|
|---|
| 66 |
|
|---|
| 67 | # This is the output of testcase-help
|
|---|
| 68 | $(PATH_TARGET)\wcl386.help.stdout: $(MAKEFILE)
|
|---|
| 69 | @$(TOOL_ECHO) Creating$(CLRRST) <<$@
|
|---|
| 70 | Watcom C/C++32 Compile and Link Utility Version 11.0c
|
|---|
| 71 | Copyright by Sybase, Inc., and its subsidiaries, 1988, 2000.
|
|---|
| 72 | All rights reserved. Watcom is a trademark of Sybase, Inc.
|
|---|
| 73 | Usage: wcl386 {option(s)} {file(s)}
|
|---|
| 74 | Options: ( - option is also accepted )
|
|---|
| 75 | /c compile only, no link
|
|---|
| 76 | /cc treat source files as C code
|
|---|
| 77 | /cc++ treat source files as C++ code
|
|---|
| 78 | /y ignore the WCL386 environment variable
|
|---|
| 79 | [Processor options]
|
|---|
| 80 | /3r 386 register calling conventions /5r Pentium register calling conv.
|
|---|
| 81 | /3s 386 stack calling conventions /5s Pentium stack calling conventions
|
|---|
| 82 | /4r 486 register calling conventions /6r Pentium Pro register call conven.
|
|---|
| 83 | /4s 486 stack calling conventions /6s Pentium Pro stack call conven.
|
|---|
| 84 | [Floating-point processor options]
|
|---|
| 85 | /fpc calls to floating-point library /fp2 generate 287 floating-point code
|
|---|
| 86 | /fpd enable Pentium FDIV check /fp3 generate 387 floating-point code
|
|---|
| 87 | /fpi inline 80x87 with emulation /fp5 optimize f-p for Pentium
|
|---|
| 88 | /fpi87 inline 80x87 /fp6 optimize f-p for Pentium Pro
|
|---|
| 89 | /fpr use old floating-point conventions
|
|---|
| 90 | [Compiler options]
|
|---|
| 91 | /db generate browsing information /s remove stack overflow checks
|
|---|
| 92 | /e=<n> set error limit number /sg generate calls to grow the stack
|
|---|
| 93 | /ee call epilogue hook routine /st touch stack through SS first
|
|---|
| 94 | /ef full paths in messages /v output func declarations to .def
|
|---|
| 95 | /ei force enums to be type int /vcap VC++ compat: alloca in arg lists
|
|---|
| 96 | /em minimum base type for enum is int /w=<n> set warning level number
|
|---|
| 97 | /en emit routine names in the code /wcd=<n> disable warning message <n>
|
|---|
| 98 | /ep[=<n>] call prologue hook routine /wce=<n> enable warning message <n>
|
|---|
| 99 | /eq do not display error messages /we treat all warnings as errors
|
|---|
| 100 | /et P5 profiling /wx (C++) set warning level to max
|
|---|
| 101 | /ez generate PharLap EZ-OMF object /xr (C++) enable RTTI
|
|---|
| 102 | /fh=<file> pre-compiled headers /z{a,e} disable/enable extensions
|
|---|
| 103 | /fhq[=<file>] fh without warnings /zc place strings in CODE segment
|
|---|
| 104 | /fhr (C++) only read PCH /zd{f,p} DS floats vs DS pegged to DGROUP
|
|---|
| 105 | /fhw (C++) only write PCH /zdl load DS directly from DGROUP
|
|---|
| 106 | /fhwe (C++) don't count PCH warnings /zf{f,p} FS floats vs FS pegged to seg
|
|---|
| 107 | /fi=<file> force include of file /zg{f,p} GS floats vs GS pegged to seg
|
|---|
| 108 | /fo=<file> set object file name /zg function prototype using base type
|
|---|
| 109 | /fr=<file> set error file name /zk{0,0u,1,2,3,l} double-byte support
|
|---|
| 110 | /ft (C++) check for 8.3 file names /zku=<codepage> UNICODE support
|
|---|
| 111 | /fx (C++) no check for 8.3 file names /zl remove default library information
|
|---|
| 112 | /g=<codegroup> set code group name /zld remove file dependency information
|
|---|
| 113 | /hc codeview debug format /zm place functions in separate segments
|
|---|
| 114 | /hd dwarf debug format /zmf (C++) zm with near calls allowed
|
|---|
| 115 | /hw watcom debug format /zp{1,2,4,8,16} struct packing align.
|
|---|
| 116 | /j change char default to signed /zpw warning when padding a struct
|
|---|
| 117 | /m{f,s,m,c,l} memory model /zq operate quietly
|
|---|
| 118 | /nc=<name> set CODE class name /zs check syntax only
|
|---|
| 119 | /nd=<name> set data segment name /zt<n> set data threshold
|
|---|
| 120 | /nm=<module_name> set module name /zu SS != DGROUP
|
|---|
| 121 | /nt=<name> set text segment name /zv (C++) enable virt. fun. removal opt
|
|---|
| 122 | /r save/restore segregs across calls /zw generate code for MS Windows
|
|---|
| 123 | /ri promote function args/rets to int /zz remove @size from __stdcall func.
|
|---|
| 124 | [Debugging options]
|
|---|
| 125 | /d0 no debugging information /d2t (C++) d2 but without type names
|
|---|
| 126 | /d1{+} line number debugging info. /d3 debug info with unref'd type names
|
|---|
| 127 | /d2 full symbolic debugging info. /d3i (C++) d3 + inlines as COMDATs
|
|---|
| 128 | /d2i (C++) d2 + inlines as COMDATs /d3s (C++) d3 + inlines as statics
|
|---|
| 129 | /d2s (C++) d2 + inlines as statics
|
|---|
| 130 | [Optimization options]
|
|---|
| 131 | /oa relax alias checking /ol+ ol with loop unrolling
|
|---|
| 132 | /ob branch prediction /om generate inline math functions
|
|---|
| 133 | /oc disable call/ret optimization /on numerically unstable floating-point
|
|---|
| 134 | /od disable optimizations /oo continue compile when low on memory
|
|---|
| 135 | /oe{=num} expand functions inline /op improve floating-point consistency
|
|---|
| 136 | /of{+} generate traceable stack frames/or re-order instructions to avoid stalls
|
|---|
| 137 | /oh enable repeated optimizations /os optimize for space
|
|---|
| 138 | /oi inline intrinsic functions /ot optimize for time
|
|---|
| 139 | /oi+ (C++) oi with max inlining depth /ou ensure unique addresses for functions
|
|---|
| 140 | /ok control flow entry/exit seq. /ox maximum optimization (/obmilr /s)
|
|---|
| 141 | /ol perform loop optimizations
|
|---|
| 142 | [C++ exception handling options]
|
|---|
| 143 | /xd no exception handling /xs exception handling: balanced
|
|---|
| 144 | /xds no exception handling: space /xss exception handling: space
|
|---|
| 145 | /xdt no exception handling /xst exception handling: time
|
|---|
| 146 | [Preprocessor options]
|
|---|
| 147 | /d<name>[=text] define a macro /u<name> undefine macro name
|
|---|
| 148 | /d+ extend syntax of /d option /p{c,l,w=<n>} preprocess source file
|
|---|
| 149 | /fo=<filename> set object file name c -> preserve comments
|
|---|
| 150 | /i=<directory> include directory l -> insert #line directives
|
|---|
| 151 | /t=<n> (C++) # of spaces in tab stop w=<n> -> wrap output at column n
|
|---|
| 152 | /tp=<name> (C) set #pragma on( <name>
|
|---|
| 153 | [Linker options]
|
|---|
| 154 | /bd build Dynamic link library /fm[=<map_file>] generate map file
|
|---|
| 155 | /bm build Multi-thread application /k<stack_size> set stack size
|
|---|
| 156 | /br build with dll run-time library /l=<system> link for the specified system
|
|---|
| 157 | /bw build default Windowing app. /x make names case sensitive
|
|---|
| 158 | /bt=<os> build target OS. @<directive_file> include file
|
|---|
| 159 | /fd[=<directive_file>] directive file /"linker directives"
|
|---|
| 160 | /fe=<executable> name executable file
|
|---|
| 161 | <<KEEP
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 | #
|
|---|
| 165 | # Testcase where we try to run compile some simple source.
|
|---|
| 166 | #
|
|---|
| 167 | testcase-compile: $(PATH_TARGET)\helloworld.c
|
|---|
| 168 | SET PATH=$(WATCOM)\winnt;$(PATH)
|
|---|
| 169 | $(TS_PEC) $(WCC386) -I$(WATCOM)\h\nt -I$(WATCOM)\h -Fo=$(PATH_TARGET)\compile.obj \
|
|---|
| 170 | $(PATH_TARGET)\helloworld.c
|
|---|
| 171 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\compile.obj
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 | #
|
|---|
| 175 | # Testcase where we try to run compile some simple source.
|
|---|
| 176 | #
|
|---|
| 177 | testcase-compile-and-link: $(PATH_TARGET)\helloworld.c
|
|---|
| 178 | SET PATH=$(WATCOM)\winnt;$(PATH)
|
|---|
| 179 | $(TS_PEC) $(WCL386) -bt=tnt -l=tnt -I$(WATCOM)\h\nt -I$(WATCOM)\h \
|
|---|
| 180 | -Fo=$(PATH_TARGET)\compileandlink.obj -Fe=$(PATH_TARGET)\compileandlink.exe \
|
|---|
| 181 | $(PATH_TARGET)\helloworld.c
|
|---|
| 182 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\compileandlink.obj
|
|---|
| 183 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\compileandlink.exe
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 | #
|
|---|
| 187 | # Testcase where we try to run doxygen on tools/common/kFileFormatBase.[cpp|h].
|
|---|
| 188 | #
|
|---|
| 189 | testcase-helloworld: \
|
|---|
| 190 | $(PATH_TARGET)\helloworld.c \
|
|---|
| 191 | $(PATH_TARGET)\helloworld.stdout
|
|---|
| 192 | SET PATH=$(WATCOM)\winnt;$(PATH)
|
|---|
| 193 | $(TS_PEC) $(WCC386) -I$(WATCOM)\h\nt -I$(WATCOM)\h -Fo=$(PATH_TARGET)\helloworld.obj \
|
|---|
| 194 | $(PATH_TARGET)\helloworld.c
|
|---|
| 195 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\helloworld.obj
|
|---|
| 196 | SET LIB=$(WATCOM)\lib386\nt;$(WATCOM)\lib386;
|
|---|
| 197 | $(TS_PEC) $(WLINK) \
|
|---|
| 198 | FORMAT Window NT \
|
|---|
| 199 | FILE $(PATH_TARGET)\helloworld.obj \
|
|---|
| 200 | NAME $(PATH_TARGET)\helloworld.exe \
|
|---|
| 201 | LIBPATH $(WATCOM)\lib386\nt;$(WATCOM)\lib386
|
|---|
| 202 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\helloworld.exe
|
|---|
| 203 | $(TOOL_COPY) $(PATH_TARGET)\helloworld.exe .\helloworld.exe
|
|---|
| 204 | $(TS_PEC) .\helloworld.exe > $(PATH_TARGET)\stdout 2> $(PATH_TARGET)\stderr
|
|---|
| 205 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\stderr
|
|---|
| 206 | $(TS_TEST_FILE_NZ) $(PATH_TARGET)\stdout
|
|---|
| 207 | $(TS_CMP) $(PATH_TARGET)\stderr <<
|
|---|
| 208 | Hello stderr
|
|---|
| 209 | <<
|
|---|
| 210 | $(TS_SED) "s/=$(MAKEDIR:\=\\)\\HELLOWORLD\.EXE/=HelloWorld\.ExE/I" $(PATH_TARGET)\stdout | $(TS_CMP) $(PATH_TARGET)\helloworld.stdout -
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 | # generate some C source code to be compiled.
|
|---|
| 214 | $(PATH_TARGET)\helloworld.c: $(MAKEFILE)
|
|---|
| 215 | @$(TOOL_ECHO) Creating$(CLRRST) <<$@
|
|---|
| 216 | #include <stdio.h> /* Needed for [f]printf prototype. */
|
|---|
| 217 | #include <sys/types.h> /* just to see if it's found. */
|
|---|
| 218 |
|
|---|
| 219 | int main(int argc, char **argv)
|
|---|
| 220 | {
|
|---|
| 221 | printf("Hello World\n");
|
|---|
| 222 | printf("argc=%d argv0=%s\n", argc, argv[0]);
|
|---|
| 223 | fprintf(stderr, "Hello stderr\n");
|
|---|
| 224 | return 0;
|
|---|
| 225 | }
|
|---|
| 226 | <<KEEP
|
|---|
| 227 |
|
|---|
| 228 | # stdout from helloworld.exe
|
|---|
| 229 | $(PATH_TARGET)\helloworld.stdout: $(MAKEFILE)
|
|---|
| 230 | @$(TOOL_ECHO) Creating$(CLRRST) <<$@
|
|---|
| 231 | Hello World
|
|---|
| 232 | argc=1 argv0=HelloWorld.ExE
|
|---|
| 233 | <<KEEP
|
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 | #
|
|---|
| 237 | # Clean rule
|
|---|
| 238 | #
|
|---|
| 239 | !if "$(MAKE_INCLUDE_PROCESS:process.forwarder=)" == "$(MAKE_INCLUDE_PROCESS)"
|
|---|
| 240 | clean:
|
|---|
| 241 | $(TOOL_RM) *.log $(PATH_TARGET)\* .\helloworld.exe
|
|---|
| 242 | !else
|
|---|
| 243 | ! ifndef BUILD_VERBOSE
|
|---|
| 244 | @ \
|
|---|
| 245 | ! endif
|
|---|
| 246 | $(TOOL_BUILDENV) $(BUILD_ENVS_CHANGE) * $(TOOL_MAKE) -f $(MAKEFILE) $@
|
|---|
| 247 | !endif
|
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 | !else
|
|---|
| 251 |
|
|---|
| 252 | # No watcom - Do nothing!
|
|---|
| 253 | TARGET_MODE = EMPTY
|
|---|
| 254 | !include $(PATH_ROOT)\$(BUILD_SETUP_MAK)
|
|---|
| 255 | !include $(MAKE_INCLUDE_PROCESS)
|
|---|
| 256 |
|
|---|
| 257 | !endif
|
|---|
| 258 |
|
|---|