- Timestamp:
- Jan 25, 2016, 4:22:26 PM (10 years ago)
- Location:
- branches/swt
- Files:
-
- 15 added
- 11 edited
-
Makefile.kmk (modified) (1 diff)
-
testapp/Makefile.kmk (modified) (1 diff)
-
testapp/apitest/ApiTest.properties (modified) (1 diff)
-
testapp/apitest/GNUmakefile (modified) (1 diff)
-
testapp/apitest/Makefile.kmk (added)
-
testapp/apitest/README (modified) (1 diff)
-
testapp/apitest/doc/.gitignore (added)
-
testapp/apitest/doc/ApiTest.txt (modified) (6 diffs)
-
testapp/apitest/fc.mnu (modified) (1 diff)
-
testapp/apitest/h (added)
-
testapp/apitest/h/.gitignore (added)
-
testapp/apitest/src/.gitignore (added)
-
testapp/apitest/src/ApiTestOdin.cpp (added)
-
testapp/apitest/src/ApiTestOdin.def (added)
-
testapp/apitest/src/ApiTestOdin.hpp (added)
-
testapp/apitest/src/ApiTestOdin.rc (added)
-
testapp/apitest/src/ApiTestOdinrsrc.orc (added)
-
testapp/apitest/src/ApiTestPm.cpp (modified) (16 diffs)
-
testapp/apitest/src/ApiTestPm.def (modified) (1 diff)
-
testapp/apitest/src/ApiTestPm.hpp (added)
-
testapp/apitest/src/ApiTestPm.rc (modified) (1 diff)
-
testapp/apitest/src/ApiTestWin.cpp (added)
-
testapp/apitest/src/ApiTestWin.def (added)
-
testapp/apitest/src/ApiTestWin.hpp (added)
-
testapp/apitest/src/ApiTestWin.rc (added)
-
testapp/apitest/src/ids.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/swt/Makefile.kmk
r22073 r22112 11 11 include $(PATH_SUB_CURRENT)/lib/Makefile.kmk 12 12 include $(PATH_SUB_CURRENT)/tools/Makefile.kmk 13 include $(PATH_SUB_CURRENT)/testapp/Makefile.kmk 13 14 include $(PATH_SUB_CURRENT)/src/Makefile.kmk 14 15 -
branches/swt/testapp/Makefile.kmk
r21916 r22112 9 9 # Include sub-makefiles. 10 10 # 11 INCLUDE_SUBDIRS = \ 12 console/file \ 13 console/fullpath \ 14 encodings \ 15 exceptions/seh \ 16 gui/fontlist \ 17 gui/input \ 18 gui/systray \ 19 network/iphlpapi \ 20 threads 11 INCLUDE_SUBDIRS = 12 INCLUDE_SUBDIRS += apitest 13 #INCLUDE_SUBDIRS += console/file 14 #INCLUDE_SUBDIRS += console/fullpath 15 #INCLUDE_SUBDIRS += encodings 16 #INCLUDE_SUBDIRS += exceptions/seh 17 #INCLUDE_SUBDIRS += gui/fontlist 18 #INCLUDE_SUBDIRS += gui/input 19 #INCLUDE_SUBDIRS += gui/systray 20 #INCLUDE_SUBDIRS += network/iphlpapi 21 #INCLUDE_SUBDIRS += threads 21 22 22 23 $(foreach dir,$(INCLUDE_SUBDIRS),$(eval include $$(PATH_SUB_CURRENT)/$(dir)/Makefile.kmk)) -
branches/swt/testapp/apitest/ApiTest.properties
r22108 r22112 1 #Initial Connection Properties 2 #Thu, 03 Dec 2015 19:39:46 +0800 1 #Developer Connection Properties 2 #The properties in this file are here to aid the developer by providing a backlink. 3 #This kinda has to do with 'modeling' and being able to 'regenerate' a published commit. 4 #Mon, 25 Jan 2016 22:33:43 -0500 3 5 4 meta-commit= none6 meta-commit=ba42daf18f7391a9815d5d7cbbb22a11559673a8 -
branches/swt/testapp/apitest/GNUmakefile
r22110 r22112 1 #! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 ############################################################################### 2 # GNUmakefile :: Build the ApiTest Pm Program#3 # GNUmakefile :: Build the ApiTest Program as multiple variants # 3 4 # --------------------------------------------------------------------------- # 4 # For this initial version we start with a PM version because, well, we are # 5 # on OS/2! However, this is not the module of focus since it is not directly # 6 # connected to the SWT for OS/2 project. Upcoming commits will bring the # 7 # Odin32 based and Native Win32 variants. # 5 # # 6 # The purpose of the ApiTest Program is to get Odin in a better shape. # 7 # Currently the main focus is on the Standard Widget Toolkit for OS/2, which # 8 # is a separate but closely related project in development. For more info see # 9 # the 'doc' directory. # 10 # # 11 # The ApiTest Program can be build as 3 variants: # 12 # ----------------------------------------------- # 13 # o A native Pm32 variant # 14 # This variant is not the true focus of ApiTest but is used to investigate # 15 # things from the Pm32 angle, especially stuff that Odin32 delegates to Pm. # 16 # # 17 # o An Odin32 Based variant # 18 # This variant is the true focus of ApiTest and relates to the test-module # 19 # of the SwtOs2Demo. That test-module addresses issues encountered through # 20 # the SwtOs2 layer while ApiTestOdin addresses these issues by directly # 21 # using the Odin32-API. Using this approach makes it easier to determine if # 22 # issues are caused at the SwtOs2 layer or by Odin. # 23 # # 24 # o A native Win32 variant # 25 # This variant is a PE-executable which causes Odin32 to handle it # 26 # differently as apposed to the Odin Based (LX-executable) variant. This # 27 # variant also runs Win(e)dows, which enables investigation of the Win32 # 28 # implementation of those environments. This is especially interesting with # 29 # regard to the Wine because its sources may contain 'cherries' for Odin. # 30 # # 31 # Currently 2 tool-chains are supported on OS/2: # 32 # ---------------------------------------------- # 33 # o Open Watcom (v1.9+) # 34 # This is the default tool-chain for these 'out-of-kBuild' builds, because # 35 # it can build all 3 variants, either on OS/2 or on Win(e)dows. # 36 # For convenience and compatibility with gcc, the 'owcc' front-end is used. # 37 # # 38 # o GNU Compiler Collection for OS/2 # 39 # This is the same tool-chain used by kBuild when building Odin. # 40 # Currently the 4.9.2 version is used at the developer site. # 41 # This tool-chain can build the Pm32 and Odin32 variants. # 42 # # 8 43 ############################################################################### 9 44 10 # This is the default target when no targets are specified. 45 # 46 # File Commander User Menu 47 # ------------------------ 48 # To ease building from the command-line, a File Commander user-menu is 49 # available. Just navigate with FC/2 to the directory containing this Makefile 50 # and press F2. Besides the normal menu navigation, one can use the hotkeys 51 # to quickly activate the desired entry. For instance, the 'bgo' key-sequence 52 # would build the Odin Based variant using GCC/2, while a sequence of 'ba' 53 # would build all variants using Open Watcom, which is the default tool-chain 54 # for these 'out-of-kBuild' builds of ApiTest. 55 # 56 57 # Get the name of this Makefile so in can be recursively invoked if needed. 58 # This should always be the first statement, so any include statements should 59 # go *below* this one. 60 SELF:=$(lastword $(MAKEFILE_LIST)) 61 62 # This is the true default target invoked when no targets are specified. 63 # Because only one target can be specified, we redirect to a target called 64 # 'default' where multiple targets can be specified as dependencies. 65 # So any changes to default behavior should not be made here but to the 66 # mentioned 'default' target defined a few paragraphs down. 11 67 .DEFAULT_GOAL:=default 12 68 13 # Use the wl.exe Open Watcom derivative for linking 69 # When using extensions that are not in the default suffixes list, the special 70 # macro '$*' which holds the stem of the target has an empty value when the 71 # recipe is executed. Adding it to the suffixes list solves this. We use the 72 # '.ors' extension (object resource) to hold the translated Win32 resources 73 # for the Odin32 variant. 74 .SUFFIXES: .ors 75 76 # Use 'wl.exe' for linking 14 77 export EMXOMFLD_TYPE=wlink 15 78 export EMXOMFLD_LINKER=wl.exe 16 79 17 # The header, source and output directories relative to this makefile80 # The header, source and output directories relative to this Makefile 18 81 inc=h 19 82 src=src 20 83 out=out 21 84 22 # While this is the first target, the true default target is 23 # specified in .DEFAULT_GOAL above. Here we'll redirect to target 'default'. 24 all: default 85 # Accumulate Open Watcom Include Directories and compose a ';' separated 86 # include-path with '/' for both for 32-bit OS/2 and 32-bit Windows. 87 WATCOM2:=$(subst \,/,$(WATCOM)) 88 OW_OS2V2_INCDIRS:=$ 89 OW_OS2V2_INCDIRS+=$(WATCOM2)/h 90 OW_OS2V2_INCDIRS+=$(WATCOM2)/h/os2 91 OW_OS2V2_INCDIRS:=$(strip $(OW_OS2V2_INCDIRS)) 92 OW_OS2V2_INCPATH:=$(subst $ ,;,$(OW_OS2V2_INCDIRS)) 93 OW_WIN32_INCDIRS:=$ 94 OW_WIN32_INCDIRS+=$(WATCOM2)/h 95 OW_WIN32_INCDIRS+=$(WATCOM2)/h/nt 96 OW_WIN32_INCDIRS:=$(strip $(OW_WIN32_INCDIRS)) 97 OW_WIN32_INCPATH:=$(subst $ ,;,$(OW_WIN32_INCDIRS)) 98 99 # Accumulate Odin32 Include Directories and compose a ';' separated 100 # include-path from them. 101 ODIN32SDK_INCDIRS:=$ 102 ODIN32SDK_INCDIRS+=../../include 103 ODIN32SDK_INCDIRS+=../../include/win 104 ODIN32SDK_INCDIRS+=../../include/win/wine 105 ODIN32SDK_INCDIRS:=$(strip $(ODIN32SDK_INCDIRS)) 106 ODIN32SDK_INCPATH:=$(subst $ ,;,$(ODIN32SDK_INCDIRS)) 107 108 # Accumulate Odin32 Library Directories (only one) and compose a ';' separated 109 # library-path from them. 110 ODIN32SDK_LIBDIRS:=$ 111 ODIN32SDK_LIBDIRS+=../../out/os2.x86/release/stage/lib 112 ODIN32SDK_LIBDIRS:=$(strip $(ODIN32SDK_LIBDIRS)) 113 ODIN32SDK_LIBPATH:=$(subst $ ,;,$(ODIN32SDK_LIBDIRS)) 114 115 # Accumulate Odin32 Libraries 116 ODIN32SDK_LIBS:=$ 117 ODIN32SDK_LIBS+=kernel32.lib 118 ODIN32SDK_LIBS+=user32.lib 119 ODIN32SDK_LIBS+=gdi32.lib 120 ODIN32SDK_LIBS:=$(strip $(ODIN32SDK_LIBS)) 121 122 # This macro is invoked by defined but not yet implemented targets 123 define target.not.implemented 124 @echo !!! Target "$@" is not implemented yet... !!! 125 endef 126 127 # Display an empty line 128 define nl 129 echo. 130 endef 131 132 # Convert a space or ';' separated list of include dirs to a list of -I flags for gcc 133 define incdirs2flags.gcc 134 $(foreach idir,$(subst ;, ,$(1)),-I$(idir)) 135 endef 136 137 # Convert a space or ';' separated list of library dirs to a list of -L flags for gcc 138 define libdirs2flags.gcc 139 $(foreach ldir,$(subst ;, ,$(1)),-L$(ldir)) 140 endef 141 142 # Convert a space or ';' separated list of library names to a list of -l flags for gcc 143 define libnames2flags.gcc 144 $(foreach lname,$(subst ;, ,$(1)),-l$(lname)) 145 endef 146 147 148 149 # ------------------------------------------------------------------- [default] 150 # This is the redirected default target from the '.DEFAULT_GOAL' statement 151 # ----------------------------------------------------------------------------- 152 # It gets invoked when no targets are specified. Any changes to the behavior of 153 # the default target should be made here by modifying the dependency list. 154 # Multiple targets can be specified on the dependency list. 155 # Please note that: 156 # When typing 'make', the default is building the 'Odin32' variant with GCC/2. 157 # However, the default from the FC/2 menu is building the 'Odin32' variant with 158 # Open Watcom. This makes is easy to switch between the two: F2 'BD' for 'owcc' 159 # or a command recall (cli:up / fc2:ctrl-up) of 'make' for 'gcc'. 160 # ----------------------------------------------------------------------------- 161 default: gcc.build.odin32 25 162 # @echo [$@] 26 163 27 # PM version of ApiTest 28 $(out)/ApiTestPm.exe: $(src)/ApiTestPm.cpp $(out)/ApiTestPm.res $(src)/ApiTestPm.def 29 @echo [$@] 30 gcc -Zomf -I$(inc) $< -o $@ $(src)/ApiTestPm.def 164 165 # ----------------------------------------------------------------------- [all] 166 # A 'well-known' target which we forward to building all 3 variants 167 # ----------------------------------------------------------------------------- 168 all: owcc.build.all 169 # @echo [$@] 170 171 172 # ------------------------------------------------------------ [owcc.build.all] 173 # This builds all 3 variants using Open Watcom 174 # ----------------------------------------------------------------------------- 175 # Double colon targets are executed in sequence and each target can have their 176 # own target-specific macros. We just use them to display the target-name that 177 # is invoked and to be able to selectively comment-out the invocation of 178 # targets declared on the dependency list, which is now split-up over multiple 179 # '::'-targets. 180 # ----------------------------------------------------------------------------- 181 owcc.build.all:: 182 @$(nl) 183 @echo [$@] 184 @echo Building all 3 variants using Open Watcom 185 owcc.build.all:: owcc.build.pm32 186 owcc.build.all:: owcc.build.odin32 187 owcc.build.all:: owcc.build.win32 188 189 190 # ----------------------------------------------------------- [owcc.build.pm32] 191 # This builds the Pm32 variant using Open Watcom 192 # ----------------------------------------------------------------------------- 193 # Because the dependency list gets evaluated before the target-specific macros, 194 # $(modulename) is not defined yet. This could be solved by '.SECONDEXPANSION:' 195 # and '$(target-specific-var)', but the 'expandproperties' task used in the 196 # code-generator at the developers site currently eats all the '$' characters. 197 # (Ant::<concat><filterchain><expandproperties/></filterchain></concat>) 198 # So we work around this by using $(eval ...), which has the side-effect that 199 # $(modulename) becomes a global variable, but that has no further impact. 200 # ----------------------------------------------------------------------------- 201 owcc.build.pm32:: 202 @$(nl) 203 @echo [$@] 204 @echo Building 'Pm32' variant using using Open Watcom 205 owcc.build.pm32:: $(eval modulename:=ApiTestPm) 206 owcc.build.pm32:: cc:=owcc 207 owcc.build.pm32:: cc.flags.sys:=-b os2v2 208 owcc.build.pm32:: cc.flags.pre:=-xc -Wc,"-q -bc" -Wl,"op q" -fo=$(out)/.obj 209 owcc.build.pm32:: cc.flags.pre+=-fd=$(out)/$(modulename).wlk 210 owcc.build.pm32:: cc.flags.pre+=-fm=$(out)/$(modulename).map 211 owcc.build.pm32:: cc.flags.incdirs:=-I. -I$(inc) 212 owcc.build.pm32:: cc.flags.libdirs:= 213 owcc.build.pm32:: cc.flags.libs:= 214 owcc.build.pm32:: cc.flags.post:= 215 owcc.build.pm32:: cc.defines:=-DNULL=0 216 owcc.build.pm32:: module.def:= 217 owcc.build.pm32:: export INCLUDE:=$(OW_OS2V2_INCPATH) 218 owcc.build.pm32:: export LIB:= 219 owcc.build.pm32:: $(out)/$(modulename).exe 220 221 222 # --------------------------------------------------------- [owcc.build.odin32] 223 # This builds the Odin32 variant using Open Watcom 224 # ----------------------------------------------------------------------------- 225 owcc.build.odin32:: 226 @$(nl) 227 @echo [$@] 228 @echo Building 'Odin32' variant using using Open Watcom 229 owcc.build.odin32:: $(eval modulename:=ApiTestOdin) 230 owcc.build.odin32:: cc:=owcc 231 owcc.build.odin32:: cc.flags.sys:=-b os2v2 232 owcc.build.odin32:: cc.flags.pre:=-xc -Wc,"-q -bc" -Wl,"op q" -fo=$(out)/.obj 233 owcc.build.odin32:: cc.flags.pre+=-fd=$(out)/$(modulename).wlk 234 owcc.build.odin32:: cc.flags.pre+=-fm=$(out)/$(modulename).map 235 owcc.build.odin32:: cc.flags.incdirs:=-I. -I$(inc) 236 owcc.build.odin32:: cc.flags.libdirs:= 237 owcc.build.odin32:: cc.flags.libs:= 238 owcc.build.odin32:: cc.flags.post:=-Wl,"file {$(out)/ApiTestOdin.ors} lib {$(ODIN32SDK_LIBS)}" 239 owcc.build.odin32:: cc.defines:=-DNULL=0 -D__i386__ -D__WIN32OS2__ 240 owcc.build.odin32:: module.def:= 241 owcc.build.odin32:: export INCLUDE:=$(OW_OS2V2_INCPATH);$(ODIN32SDK_INCPATH) 242 owcc.build.odin32:: export LIB:=$(ODIN32SDK_LIBPATH) 243 owcc.build.odin32:: $(out)/$(modulename).exe 244 245 246 # ---------------------------------------------------------- [owcc.build.win32] 247 # This builds the Win32 variant using Open Watcom 248 # ----------------------------------------------------------------------------- 249 owcc.build.win32:: 250 @$(nl) 251 @echo [$@] 252 @echo Building 'Win32' variant using using Open Watcom 253 owcc.build.win32:: $(eval modulename:=ApiTestWin) 254 owcc.build.win32:: cc:=owcc 255 owcc.build.win32:: cc.flags.sys:=-b nt 256 owcc.build.win32:: cc.flags.pre:=-xc -Wc,"-q -bc" -Wl,"op q" -fo=$(out)/.obj 257 owcc.build.win32:: cc.flags.pre+=-fd=$(out)/$(modulename).wlk 258 owcc.build.win32:: cc.flags.pre+=-fm=$(out)/$(modulename).map 259 owcc.build.win32:: cc.flags.incdirs:=-I. -I$(inc) 260 owcc.build.win32:: cc.flags.libdirs:= 261 owcc.build.win32:: cc.flags.libs:= 262 owcc.build.win32:: cc.flags.post:= 263 owcc.build.win32:: cc.defines:=-DNULL=0 264 owcc.build.win32:: module.def:= 265 owcc.build.win32:: export INCLUDE:=$(OW_WIN32_INCPATH) 266 owcc.build.win32:: export LIB:= 267 owcc.build.win32:: $(out)/$(modulename).exe 268 269 270 # ------------------------------------------------------------- [gcc.build.all] 271 # This builds the Pm32 and Odin32 variants using the GNU/2 tool-chain 272 # ----------------------------------------------------------------------------- 273 gcc.build.all:: 274 @$(nl) 275 @echo [$@] 276 @echo Building 'Pm32' and 'Odin32' variants using GCC/2 277 gcc.build.all:: gcc.build.pm32 278 gcc.build.all:: gcc.build.odin32 279 #gcc.build.all:: gcc.build.win32 280 281 282 # ----------------------------------------------------------- [gcc.build.pm32] 283 # This builds the Pm32 variant using the GNU/2 tool-chain 284 # ----------------------------------------------------------------------------- 285 gcc.build.pm32:: 286 @$(nl) 287 @echo [$@] 288 @echo Building 'Pm32' variant using using GCC/2 289 gcc.build.pm32:: $(eval modulename:=ApiTestPm) 290 gcc.build.pm32:: cc:=gcc 291 gcc.build.pm32:: cc.flags.sys:=-Zomf -Zmap 292 gcc.build.pm32:: cc.flags.pre:=-xc 293 gcc.build.pm32:: cc.flags.incdirs:=-I. -I$(inc) 294 gcc.build.pm32:: cc.flags.libdirs:= 295 gcc.build.pm32:: cc.flags.libs:= 296 gcc.build.pm32:: cc.flags.post:=-Wl,"$(src)/$(modulename).def" 297 gcc.build.pm32:: cc.defines:=-DNULL=0 298 gcc.build.pm32:: module.def:= 299 gcc.build.pm32:: export INCLUDE:= 300 gcc.build.pm32:: export C_INCLUDE_PATH:= 301 gcc.build.pm32:: export CPLUS_INCLUDE_PATH:= 302 gcc.build.pm32:: $(out)/$(modulename).exe 303 304 305 # ---------------------------------------------------------- [gcc.build.odin32] 306 # This builds the Odin32 variant using the GNU/2 tool-chain 307 # ----------------------------------------------------------------------------- 308 gcc.build.odin32:: 309 @$(nl) 310 @echo [$@] 311 @echo Building 'Odin32' variant using using GCC/2 312 gcc.build.odin32:: $(eval modulename:=ApiTestOdin) 313 gcc.build.odin32:: cc:=gcc 314 gcc.build.odin32:: cc.flags.sys:=-Zomf -Zmap 315 gcc.build.odin32:: cc.flags.pre:=-xc 316 gcc.build.odin32:: cc.flags.incdirs:=-I. -I$(inc) 317 gcc.build.odin32:: cc.flags.libdirs:=$(call libdirs2flags.gcc,$(ODIN32SDK_LIBDIRS)) 318 gcc.build.odin32:: cc.flags.libs:=$(call libnames2flags.gcc,$(ODIN32SDK_LIBS)) 319 gcc.build.odin32:: cc.flags.post:=-Wl,"$(out)/ApiTestOdin.ors" -Wl,"$(src)/$(modulename).def" 320 gcc.build.odin32:: cc.defines:=-DNULL=0 -D__i386__ -D__WIN32OS2__ 321 gcc.build.odin32:: export INCLUDE:=$(ODIN32SDK_INCPATH) 322 gcc.build.odin32:: export C_INCLUDE_PATH:=$(ODIN32SDK_INCPATH) 323 gcc.build.odin32:: export CPLUS_INCLUDE_PATH:=$(ODIN32SDK_INCPATH) 324 gcc.build.odin32:: module.def:= 325 gcc.build.odin32:: $(out)/$(modulename).exe 326 327 328 # ------------------------------------------------------------- [ApiTestPm.exe] 329 # Build the Pm32 target executable (LX) 330 # ----------------------------------------------------------------------------- 331 $(out)/ApiTestPm.exe: $(src)/ApiTestPm.cpp $(out)/ApiTestPm.res $(module.def) 332 @echo [$@] 333 $(cc) $(cc.flags.sys) $(cc.flags.pre) $(cc.flags.incdirs) $(cc.flags.libdirs) $(cc.flags.libs) $(cc.flags.post) $(cc.defines) $< -o $@ 31 334 wrc -q -bt=os2 -zm $*.res $@ 32 335 336 337 # ------------------------------------------------------------- [ApiTestPm.res] 338 # Compile the Pm32 resources to binary form 339 # ----------------------------------------------------------------------------- 33 340 $(out)/ApiTestPm.res: $(src)/ApiTestPm.rc 34 341 @echo [$@] 342 @if not exist $(out) mkdir $(out) 35 343 wrc -q -r -bt=os2 -zm -fo=$@ $< 36 344 37 # The default target 38 default: $(out)/ApiTestPm.exe 39 # @echo [$@] 40 41 # Redirect to target 'default' 345 346 # ----------------------------------------------------------- [ApiTestOdin.exe] 347 # Build the Odin32 target executable (LX) 348 # ----------------------------------------------------------------------------- 349 $(out)/ApiTestOdin.exe: $(src)/ApiTestOdin.cpp $(out)/ApiTestOdin.ors $(module.def) 350 @echo [$@] 351 $(cc) $(cc.flags.sys) $(cc.flags.pre) $(cc.flags.incdirs) $(cc.flags.libdirs) $(cc.flags.libs) $(cc.flags.post) $(cc.defines) $< -o $@ 352 353 354 # ----------------------------------------------------------- [ApiTestOdin.ors] 355 # Translate the Win32 resource source to binary form 356 # ----------------------------------------------------------------------------- 357 # Resources for Odin Based applications (LX) are bound by first translating 358 # the Win32 resource source (.rc) to Assembly and then assembling the assembler 359 # source (.s) to an object file (.ors), which is linked-in when building the 360 # target executable. This target performs those steps and could be considered 361 # a case of 'early binding' as opposed to normal resource binding (.res) which 362 # is done after the target executable is built, which is 'late binding'. 363 # Unlike with regular Odin kBuilds, we do not use the 'rsrc' suffix on the 364 # modulename, but name the object '.ors', which is short for 'object resource'. 365 # The '.ors' file is in regular OMF however. 366 # ----------------------------------------------------------------------------- 367 $(out)/ApiTestOdin.ors: $(src)/ApiTestOdin.rc 368 @echo [$@] 369 @if not exist $(out) mkdir $(out) 370 winerc -D__WIN32OS2__ -s $(cc.flags.incdirs) -I$(src) $< -o $*.s 371 as -Zomf $*.s -o $@ 372 373 374 # ------------------------------------------------------------ [ApiTestWin.exe] 375 # Build the Win32 target executable (PE) 376 # ----------------------------------------------------------------------------- 377 $(out)/ApiTestWin.exe: $(src)/ApiTestWin.cpp $(out)/ApiTestWin.res $(module.def) 378 @echo [$@] 379 $(cc) $(cc.flags.sys) $(cc.flags.pre) $(cc.flags.incdirs) $(cc.flags.libdirs) $(cc.flags.libs) $(cc.flags.post) $(cc.defines) $< -o $@ $(module.def) 380 wrc -q -bt=nt -zm $*.res $@ 381 382 383 # ------------------------------------------------------------ [ApiTestWin.res] 384 # Compile the Win32 resources to binary form 385 # ----------------------------------------------------------------------------- 386 $(out)/ApiTestWin.res: $(src)/ApiTestWin.rc 387 @echo [$@] 388 @if not exist $(out) mkdir $(out) 389 wrc -q -r -bt=nt -zm -fo=$@ $< 390 391 392 # --------------------------------------------------------------------- [build] 393 # Redirect to a target that is considered to do the default build 394 # ----------------------------------------------------------------------------- 42 395 build: default 43 396 # @echo [$@] 44 397 45 # Cleanup files 398 399 # ------------------------------------------------------------------ [run.pm32] 400 # Run the Pm32 variant 401 # ----------------------------------------------------------------------------- 402 run.pm32: owcc.build.pm32 403 @echo [$@] 404 $(out)\ApiTestPm.exe 405 406 407 # ---------------------------------------------------------------- [run.odin32] 408 # Run the Odin32 variant 409 # ----------------------------------------------------------------------------- 410 # Observation: *** App compiled as WINDOWAPI is started as WINDOWCOMPAT *** 411 # Starting a WINDOWAPI compiled Odin Based app directly (without 'cmd /c') 412 # starts it a WINDOWCOMPAT, thus waiting for it to end and stdout visible on 413 # the console. Using 'cmd /c' makes the starting behave correctly for both 414 # WINDOWCOMPAT and WINDOWAPI. Both 'make' and 'kmk' exhibit this behavior while 415 # 'nmake' (v4.00) does not. I wonder if this is related to the pe/pec quirk 416 # below... 417 # ----------------------------------------------------------------------------- 418 run.odin32: owcc.build.odin32 419 @echo [$@] 420 # $(out)\ApiTestOdin.exe 421 cmd /c $(out)\ApiTestOdin.exe 422 423 424 # ------------------------------------------------------------- [run.win32.pec] 425 # Run the Win32 variant using pec 426 # ----------------------------------------------------------------------------- 427 # Quirk: *** Both pe and pec fail when started from 'make' or 'kmk' *** 428 # The pec.exe program pops up a stange dialog about not finding '?kLIBc?.exe'. 429 # The pe.exe program does not even show anything but returns with an error. 430 # Possibly an environment (shell? / klibc?) issue. 431 # Under investigation; for now 'cmd /c' works around this issue. 432 # ----------------------------------------------------------------------------- 433 run.win32.pec: owcc.build.win32 434 @echo [$@] 435 # pec $(out)\ApiTestWin.exe 436 cmd /c pec $(out)\ApiTestWin.exe 437 438 439 # ---------------------------------------------------------- [run.win32.win32k] 440 # Run the Win32 variant using the win32k.sys driver 441 # ----------------------------------------------------------------------------- 442 run.win32.win32k: owcc.build.win32 443 @echo [$@] 444 $(out)\ApiTestWin.exe 445 446 # ----------------------------------------------------------- [gen.tools.flags] 447 # Dump the usage flags of some tools used 448 # ----------------------------------------------------------------------------- 449 gen.tools.flags: 450 @echo [$@] 451 -owcc -? 2> .flags.owcc 452 -wcc386 > .flags.wcc386 453 -wpp386 > .flags.wpp386 454 -wcl386 > .flags.wcl386 455 -gcc --help > .flags.gcc 456 -gcc --help=common > .flags.gcc.common 457 458 # --------------------------------------------------------------------- [clean] 459 # Cleanup by removing the complete out-directory 460 # ----------------------------------------------------------------------------- 46 461 clean: 47 462 @echo [$@] 48 rm -f -v $(out)/*.exe $(out)/*.res 49 50 # Run the program 51 run: build 52 @echo [$@] 53 $(out)/ApiTestPm.exe 54 55 # Distribute to somewhere (NI) 56 dist: 57 @echo [$@] 463 rm -rf -v $(out) 464 # rd $(out) -
branches/swt/testapp/apitest/README
r22107 r22112 1 #! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 3 :: ApiTest -- A program to test several aspects of the Odin32 API :: -
branches/swt/testapp/apitest/doc/ApiTest.txt
r22107 r22112 1 #! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 3 :: ApiTest -- Additional Information :: … … 16 17 SwtOs2Demo contains a test-module. However, this test-module is not completely 17 18 sufficient because it uses the SWT-JNI layer which makes is harder to identify 18 Odin32 specific issues and most omportantly, where best to fix these.19 Odin32 specific issues and most importantly, where best to fix these. 19 20 20 21 … … 42 43 The UniScribe and GdiPlus modules are examples of such modules, modules where 43 44 Odin32 either has partial implementation, or none at all. The third purpose of 44 the ApiTest program is to aid in the implementation of the missing modules.45 the ApiTest program is to aid in the implementation of these missing modules. 45 46 46 47 … … 55 56 The multi-toolchain part means that besides the standard GCC-OS/2 toolchain, 56 57 other toolchains like Open Watcom, MinGW, IBM Visual Age/Win, MS Visual Studio, 57 ..., can be used.58 Borland C/C++, etc., can be used. 58 59 59 60 … … 64 65 Building ApiTest as part of a normal Odin32 build has been enabled by providing 65 66 the required kBuild Makefile. Note that the regular kBuild build will only 66 build ApiTest as an Odin Based application using the GCC-OS/2 toolchain. 67 build ApiTest as an Odin Based application using the GCC-OS/2 toolchain. This 68 is of course the variant of interest with regard to testing the Odin32-API. 67 69 68 70 69 71 Building the other ApiTest variants 70 72 ----------------------------------- 71 To build the other variants of ApiTest, a regular 'GNUmakefile' is present sin72 the 'testapp/apitest' directory. This Makefile will extend with the addition73 To build the other variants of ApiTest, a regular 'GNUmakefile' is present in 74 the 'testapp/apitest' directory. This Makefile will extended with the addition 73 75 of targets and toolchains. To provide an easy menu-driven build-interface, 74 76 a File Commander/2 user-menu is present. Just navigate with FC/2 to the … … 86 88 sources seem to contain identical code, which could easily be combined using 87 89 #ifdef statements. In the case of Software Modeling however, such code is 88 generated from the same snippet and doing away with #ifdef c alrifies sources.90 generated from the same snippet and doing away with #ifdef clarifies sources. 89 91 Another thing that might catch attention is the unusual use of 'do-while'. 90 92 This is done to create a snippet which is a kind of independent entity with 91 the possibility to use 'break' to escape from the do-while block. 93 the possibility to use 'break' to escape from the do-while block. One of the 94 many advantages of using Software Modeling is that it is possible to inject all 95 kinds of debug and test code without using conditional compilation. Producing 96 release source-code is just a regeneration-without-debug away. -
branches/swt/testapp/apitest/fc.mnu
r22107 r22112 1 #! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 # 2 # Simple User Menu for File Commander.3 # User Menu for File Commander to build the 3 variants. 3 4 # Info: Starting with File Commander v2.40, XML syntax highlighting is functional. 4 5 # 5 6 6 #7 # Very, very simple Build Menu.8 #9 7 B: Build 10 make build 8 { 9 D: Default (Odin32 variant) [owcc] 10 make -B owcc.build.odin32 11 A: All variants [owcc] 12 make -B owcc.build.all 13 -: ---------------------------------- 14 P: Pm32 variant [owcc] 15 make -B owcc.build.pm32 16 O: Odin32 variant [owcc] 17 make -B owcc.build.odin32 18 W: Win32 variant [owcc] 19 make -B owcc.build.win32 20 -: ---------------------------------- 21 G: GNU Tool Chain 22 { 23 D: Default (Odin32 variant) [gcc] 24 make -B gcc.build.odin32 25 A: All variants [gcc] 26 make -B gcc.build.all 27 -: --------------------------------- 28 P: Pm32 variant [gcc] 29 make -B gcc.build.pm32 30 O: Odin32 variant [gcc] 31 make -B gcc.build.odin32 32 } 33 } 34 R: Run 35 { 36 D: Default (Odin32 variant) 37 make run.odin32 38 -: -------------------------------- 39 P: Pm32 variant 40 make run.pm32 41 O: Odin32 variant 42 make run.odin32 43 W: Win32 variant (using pec.exe) 44 make run.win32.pec 45 -: -------------------------------- 46 K: Win32 variant (using win32k.sys) 47 make run.win32.win32k 48 } 49 G: Generate Tools Flags 50 make gen.tools.flags 11 51 C: Clean 12 52 make clean 13 R: Run14 make run -
branches/swt/testapp/apitest/src/ApiTestPm.cpp
r22109 r22112 1 1 //! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 2 2 /*****************************************************************************\ 3 * ApiTestPm.cpp *3 * ApiTestPm.cpp :: This is the PM variant of ApiTest * 4 4 * --------------------------------------------------------------------------- * 5 * Th is is the PM version of the ApiTest program.*6 * It is used as a casco to construct the basic structure.*7 * Note that this is not the program of focus, that would be the Odin32 and*8 * Win32 variants which will use the Odin32-API and will be added in upcoming*9 * commits.*5 * The PM version has a different purpose than the Odin Based and Windows * 6 * variants. Here the focus is not directly on testing the Odin32-API, but * 7 * rather on testing the OS/2-API. While Odin implements a lot of Win32 * 8 * functionality from scratch, there are also situations where things are * 9 * delegated to OS/2. This variant provides that angle. * 10 10 \*****************************************************************************/ 11 11 12 12 13 13 /* 14 // Include the standard C/C++ headers.14 // Standard C/C++ Headers 15 15 */ 16 16 #include <stdlib.h> … … 18 18 #include <string.h> 19 19 20 /* 21 // Include the Platform headers for OS/2. 20 21 22 /* 23 // Platform Headers for OS/2 22 24 */ 23 25 #define INCL_DOS … … 26 28 27 29 28 /* 29 // Module related include-files. 30 31 /* 32 // Module Headers 30 33 */ 31 34 #include "ids.h" 32 33 /* 34 // Minimal Window Procedure. 35 */ 36 MRESULT EXPENTRY PmWindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { 35 #include "ApiTestPm.hpp" 36 37 38 39 /* 40 // Minimal Window Procedure 41 */ 42 MRESULT EXPENTRY Pm32WindowProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { 37 43 /* 38 44 // Local Variables follow here. … … 54 60 /* 55 61 // Create a button on the client-window 56 // ------------------------------------57 // So we can quickly exit the application by just pressing58 // the space-bar.59 62 */ 60 63 do { … … 63 66 /* Create the button */ 64 67 hwndButton = WinCreateWindow( 65 hwnd, // Parent (client-window)66 WC_BUTTON, // We want a window of class WC_BUTTON67 (PSZ)"Bye", // The button-text68 WS_VISIBLE|BS_PUSHBUTTON, // Make it visible69 20, // The x-pos from llc70 20, // The y-pos from llc71 100, // Width of the button72 50, // Height of the button73 hwnd, // Owner (client-window)74 HWND_TOP, // Z-order75 ID_EXIT, // Window ID76 NULL, // Control Data (none)77 NULL // Presentation Parameters (none)68 hwnd, // Parent (client-window) 69 WC_BUTTON, // We want a window of class WC_BUTTON 70 (PSZ)"Bye", // The button-text 71 WS_VISIBLE|BS_PUSHBUTTON, // Make it visible 72 20, // The x-pos from llc 73 20, // The y-pos from llc 74 100, // Width of the button 75 50, // Height of the button 76 hwnd, // Owner (client-window) 77 HWND_TOP, // Z-order 78 ID_EXIT, // Window ID 79 NULL, // Control Data (none) 80 NULL // Presentation Parameters (none) 78 81 ); 79 82 /* Give the focus to the button */ … … 120 123 printf("WM_COMMAND received, id: %04d\n", SHORT1FROMMP(mp1)); 121 124 break; 122 125 default: 126 mres = WinDefWindowProc(hwnd, msg, mp1, mp2); 127 break; 123 128 } 124 129 break; /*WM_COMMAND*/ … … 133 138 134 139 /* 140 // Request to quit the application. 141 */ 142 case WM_QUIT: 143 printf("WM_QUIT received\n"); 144 mres = WinDefWindowProc(hwnd, msg, mp1, mp2); 145 break; 146 147 /* 135 148 // Request to close the application. 149 // On PM this this posts a WM_QUIT message which in turn terminates 150 // the message-loop. Only an explicit call to WinDestroyWindow() 151 // seems to generate a WM_DESTROY message, which we do after the loop 152 // has terminated. 153 // On Win32 WM_CLOSE does a DestroyWindow() but does not post a WM_QUIT 154 // message and thus does not terminate the message-loop. 136 155 */ 137 156 case WM_CLOSE: … … 142 161 /* 143 162 // Window is being destroyed, time to cleanup resources allocated. 163 // This message seems only to be sent on a WinDestroyWindow() call. 164 // When clicking the close-button and not doing an explicit 165 // WinDestroyWindow() does not output the message below. 144 166 */ 145 167 case WM_DESTROY: … … 166 188 167 189 /* 168 // PmMain Selective EntryPoint.169 */ 170 int PmMain(int argc, char* argv[]) {190 // Gui EntryPoint for Presentation Manager 191 */ 192 int APIENTRY PmMain(int argc, char* argv[]) { 171 193 BOOL brc = FALSE; // Boolean return values 172 194 APIRET ulrc = -1; // Numeric return values … … 185 207 FCF_TASKLIST // Put the beast in the task-list 186 208 }; 187 PSZ pszClassClient = (PSZ) " PmMainWindow";// Window Class Name188 PSZ pszTitle = (PSZ) "ApiTestPm :: Main Window ";// Window Title209 PSZ pszClassClient = (PSZ) "ApiTestPm"; // Window Class Name 210 PSZ pszTitle = (PSZ) "ApiTestPm :: Main Window [generated:201601252233]"; // Window Title 189 211 ULONG flStyleClient = 0; // Style for Client Window 190 212 HWND hwndFrame = NULL; // Receives handle for Frame Window 191 213 HWND hwndClient = NULL; // Receives handle for Client Window 192 193 214 194 215 … … 207 228 208 229 209 210 230 /* Initialize the PM Graphics System */ 211 231 hab = WinInitialize(NULL); … … 215 235 216 236 /* Register the class of the Main Window */ 217 brc = WinRegisterClass(hab, pszClassClient, Pm WindowProc, CS_SIZEREDRAW, 0);237 brc = WinRegisterClass(hab, pszClassClient, Pm32WindowProc, CS_SIZEREDRAW, 0); 218 238 219 239 /* Create the Main Window */ … … 229 249 &hwndClient // Storage for Client Handle 230 250 ); 231 232 251 233 252 … … 250 269 printf("Continuing program...\n"); 251 270 } while (0); 252 253 271 254 272 … … 272 290 WinDispatchMsg(hab, &qmsg); 273 291 292 /* Destroy the Main Window -- causes WM_DESTROY to be sent */ 293 brc = WinDestroyWindow(hwndFrame); 294 274 295 /* Destroy the message-queue for this (main) thread */ 275 296 brc = WinDestroyMsgQueue(hmq); … … 286 307 287 308 288 /* 289 // This is the standard C/C++ EntryPoint. 309 310 /* 311 // This is the standard C/C++ EntryPoint 290 312 */ 291 313 int main(int argc, char* argv[]) { 292 314 printf("\n"); 293 315 printf("%s\n","###############################################################################"); 294 printf("%s\n","# This is the PM v ersion of ApiTest version.201512030711#");316 printf("%s\n","# This is the PM variant of ApiTest version.201601252233 #"); 295 317 printf("%s\n","###############################################################################"); 296 318 printf("\n"); -
branches/swt/testapp/apitest/src/ApiTestPm.def
r22109 r22112 1 ;#! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 ;############################################################################## 2 3 ;# ApiTestPm.def :: Module Definition file # 3 4 ;# -------------------------------------------------------------------------- # 4 ;# PmApiTest is the PM version of the ApiTest program. # 5 ;# It has a different purpose than the Odin32 based and Native Win32 versions,# 6 ;# which is to test Odin32 from Native PM. # 7 ;# This version has low development priority since it does not directly # 8 ;# connect to SWT-OS2, which is the project depending on Odin32. # 5 ;# This is the PM variant of the ApiTest program. # 6 ;# Purpose is to test the OS/2-API in areas where Odin32 delegates to it. # 9 7 ;############################################################################## 10 8 11 12 NAME ApiTestPm WINDOWCOMPAT9 ;NAME ApiTestPm WINDOWAPI ; PM 10 NAME ApiTestPm WINDOWCOMPAT ; CLI 13 11 DESCRIPTION 'A Program to test the Odin32 API from Native PM' 14 -
branches/swt/testapp/apitest/src/ApiTestPm.rc
r22110 r22112 1 //! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 /*****************************************************************************\ 2 * resource.rc :: PM Resources*3 * ApiTestPm.rc :: PM Resources * 3 4 * --------------------------------------------------------------------------- * 4 5 * OS/2 resource management is different from Win32 resource management. * -
branches/swt/testapp/apitest/src/ids.h
r22107 r22112 1 //! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 1 2 /*****************************************************************************\ 2 3 * ids.h :: Numeric Resource Identifiers * 3 4 * --------------------------------------------------------------------------- * 4 * Used by all buildable v ersions of ApiTest. *5 * Used by all buildable variants of ApiTest. * 5 6 \*****************************************************************************/ 6 7
Note:
See TracChangeset
for help on using the changeset viewer.
