- Timestamp:
- Mar 18, 2016, 6:40:30 PM (10 years ago)
- File:
-
- 1 edited
-
branches/swt/testapp/apitest/GNUmakefile (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/swt/testapp/apitest/GNUmakefile
r22119 r22130 1 # Use the new build-method if __NEW_BUILD_METHOD__ is defined 2 ifneq ($(origin __NEW_BUILD_METHOD__),undefined) 3 4 ############################################################################### 5 # GNUmakefile :: Build the ApiTest Program as multiple variants # 6 # --------------------------------------------------------------------------- # 7 # # 8 # The purpose of the ApiTest Program is to get Odin in a better shape. # 9 # Currently the main focus is on the Standard Widget Toolkit for OS/2, which # 10 # is a separate but closely related project in development. For more info see # 11 # the 'doc' directory. # 12 # # 13 # Note: # 14 # This is the new build-method. # 15 # It is based on the toolchain-wrappers and pattern-rules. # 16 # The old method will be removed when the new method fully functional. # 17 # # 18 ############################################################################### 19 20 # 21 # This new method uses toolchain-wrapping together with pattern-rules. 22 # It has been developed to ease the connection between the upcoming generation 23 # of source-code based on ECore Models. 24 # 25 26 # Get the name of this Makefile so in can be recursively invoked if needed. 27 # This should always be the first statement, so any include statements should 28 # go *below* this one. 29 SELF:=$(lastword $(MAKEFILE_LIST)) 30 31 # This is the true default target invoked when no targets are specified. 32 .DEFAULT_GOAL:=default 33 34 # Prevent Make from deleting intermediate targets 35 .SECONDARY: 36 37 # Disable standard suffix handlers so unhandled targets end-up at '.DEFAULT:' 38 .SUFFIXES: 39 40 # Enable this to use (target-specific) vars as a dependency in the same target 41 #.SECONDEXPANSION: 42 43 # Unhandles targets end-up here 44 .DEFAULT: 45 @echo !!!!! Unhandled Target: [$@ -- {$^}] 46 47 # This is the default target when no targets are specified 48 #~ default: ApiTestPm.watcom 49 default: ApiTestOdin.watcom 50 #~ default: ApiTestWin.watcom 51 #~ default: ApiTestWin.mingw32msvc 52 #~ default: ApiTestWin.mingw32 53 #~ default: ApiTestWin.mingw64 54 #~ default: test 55 56 # The header, resources, source and output dirs relative to this Makefile 57 inc=h 58 rsrc=rsrc 59 src=src 60 out=out 61 62 # Include the toolchain wrappers and target building rules 63 include toolchains.gmi 64 include patternrules.gmi 65 66 # Create the output directory 67 $(shell $(md) $(out)) 68 $(info created output-directory: '$(out)') 69 70 # --------------------------------------------------------------------------- # 71 # ApiTestPm.gcc.os2 :: OS/2 Presentation Manager variant # 72 # --------------------------------------------------------------------------- # 73 .PHONY: ApiTestPm.gcc.os2 74 ApiTestPm.gcc.os2:: 75 $(nl) 76 @echo [$@] 77 @echo --------------------------------------------------------------------- 78 @echo Building $(basename $@) using GCC for OS/2 :: OS/2 LX 79 @echo --------------------------------------------------------------------- 80 ApiTestPm.gcc.os2:: toolchain=toolchain.gcc.os2 81 #ApiTestPm.gcc.os2:: cc++:=compiler-override-command 82 ApiTestPm.gcc.os2:: $(out)/ApiTestPm.exe 83 84 # --------------------------------------------------------------------------- # 85 # ApiTestOdin.gcc.os2 :: Odin based variant # 86 # --------------------------------------------------------------------------- # 87 .PHONY: ApiTestOdin.gcc.os2 88 ApiTestOdin.gcc.os2:: 89 $(nl) 90 @echo [$@] 91 @echo --------------------------------------------------------------------- 92 @echo Building $(basename $@) using GCC for OS/2 :: OS/2 LX 93 @echo --------------------------------------------------------------------- 94 ApiTestOdin.gcc.os2:: toolchain=toolchain.gcc.os2 95 #ApiTestOdin.gcc.os2:: cc++:=compiler-override-command 96 ApiTestOdin.gcc.os2:: $(out)/ApiTestOdin.exe 97 98 # --------------------------------------------------------------------------- # 99 # ApiTestPm.watcom :: OS/2 Presentation Manager variant # 100 # --------------------------------------------------------------------------- # 101 .PHONY: ApiTestPm.watcom 102 ApiTestPm.watcom:: 103 $(nl) 104 @echo [$@] 105 @echo --------------------------------------------------------------------- 106 @echo Building $(basename $@) using OpenWatcom :: OS/2 LX 107 @echo --------------------------------------------------------------------- 108 ApiTestPm.watcom:: toolchain=toolchain.openwatcom 109 ApiTestPm.watcom:: cc.defines+=-D$* 110 ApiTestPm.watcom:: $(out)/ApiTestPm.exe 111 112 # --------------------------------------------------------------------------- # 113 # ApiTestOdin.watcom :: Odin Based variant # 114 # --------------------------------------------------------------------------- # 115 .PHONY: ApiTestOdin.watcom 116 ApiTestOdin.watcom:: 117 $(nl) 118 @echo [$@] 119 @echo --------------------------------------------------------------------- 120 @echo Building $(basename $@) using OpenWatcom :: OS/2 LX 121 @echo --------------------------------------------------------------------- 122 ApiTestOdin.watcom:: toolchain=toolchain.openwatcom 123 ApiTestOdin.watcom:: $(out)/ApiTestOdin.ors $(out)/ApiTestOdin.exe 124 125 # --------------------------------------------------------------------------- # 126 # ApiTestOdin.watcom :: Native Win32 variant # 127 # --------------------------------------------------------------------------- # 128 .PHONY: ApiTestWin.watcom 129 ApiTestWin.watcom:: 130 $(nl) 131 @echo [$@] 132 @echo --------------------------------------------------------------------- 133 @echo Building $(basename $@) using OpenWatcom :: Win32 PE32 134 @echo --------------------------------------------------------------------- 135 ApiTestWin.watcom:: toolchain=toolchain.openwatcom 136 ApiTestWin.watcom:: $(out)/ApiTestWin.exe 137 138 # --------------------------------------------------------------------------- # 139 # ApiTestWin.mingw32msvc :: Native Win32 variant # 140 # --------------------------------------------------------------------------- # 141 .PHONY: ApiTestWin.mingw32msvc 142 ApiTestWin.mingw32msvc:: 143 $(nl) 144 @echo [$@] 145 @echo --------------------------------------------------------------------- 146 @echo Building $(basename $@) using MinGW32msvc :: Win32 PE32 147 @echo --------------------------------------------------------------------- 148 ApiTestWin.mingw32msvc:: toolchain=toolchain.mingw32msvc 149 ApiTestWin.mingw32msvc:: cc.flags.pre+= 150 ApiTestWin.mingw32msvc:: $(out)/ApiTestWin.exe 151 152 # --------------------------------------------------------------------------- # 153 # ApiTestWin.mingw32 :: Native Win32 variant # 154 # --------------------------------------------------------------------------- # 155 .PHONY: ApiTestWin.mingw32 156 ApiTestWin.mingw32:: 157 $(nl) 158 @echo [$@] 159 @echo --------------------------------------------------------------------- 160 @echo Building $(basename $@) using MinGW32 :: Win32 PE32 161 @echo --------------------------------------------------------------------- 162 ApiTestWin.mingw32:: toolchain=toolchain.mingw32 163 ApiTestWin.mingw32:: cc.flags.pre+=-xc 164 ApiTestWin.mingw32:: $(out)/ApiTestWin.exe 165 166 # --------------------------------------------------------------------------- # 167 # ApiTestWin.mingw64 :: Native Win64 variant # 168 # --------------------------------------------------------------------------- # 169 .PHONY: ApiTestWin.mingw64 170 ApiTestWin.mingw64:: 171 $(nl) 172 @echo [$@] 173 @echo --------------------------------------------------------------------- 174 @echo Building $(basename $@) using MinGW64 :: Win64 PE64 175 @echo --------------------------------------------------------------------- 176 ApiTestWin.mingw64:: toolchain=toolchain.mingw64 177 ApiTestWin.mingw64:: cc.flags.pre+=-xc 178 ApiTestWin.mingw64:: lnk.flags.pre=-mwindows 179 ApiTestWin.mingw64:: $(out)/ApiTestWin.exe 180 181 # OS/2 Pm variant 182 $(out)/ApiTestPm.obj: bits=32 183 #$(out)/ApiTestPm.obj: export INCLUDE=$(WATCOM)$/$(watcom.hdir)$;$(WATCOM)$/h$/os2 184 185 186 $(out)/ApiTestPm.exe: platform=os2v2 187 $(out)/ApiTestPm.exe: gui=pm32 188 $(out)/ApiTestPm.exe: module.rc=$(src)/ApiTestPm.rc 189 $(out)/ApiTestPm.exe: module.def=$(src)/ApiTestPm.def 190 $(out)/ApiTestPm.exe: cc.flags.defines=-DNULL=0 191 $(out)/ApiTestPm.exe: $(out)/ApiTestPm.obj 192 193 # OS/2 Odin variant 194 $(out)/ApiTestOdin.obj: bits=32 195 #$(out)/ApiTestOdin.obj: export INCLUDE=$(WATCOM)$/$(watcom.hdir)$;$(WATCOM)$/h$/nt 196 197 $(out)/ApiTestOdin.exe: platform=os2v2 198 $(out)/ApiTestOdin.exe: gui=odin32 199 $(out)/ApiTestOdin.exe: module.rc=$(src)/ApiTestOdin.rc 200 $(out)/ApiTestOdin.exe: module.def=$(src)/ApiTestOdin.def 201 $(out)/ApiTestOdin.exe: cc.flags.defines=-DNULL=0 202 $(out)/ApiTestOdin.exe: $(out)/ApiTestOdin.obj 203 204 # Windows variant 205 $(out)/ApiTestWin.obj: bits=32 206 207 $(out)/ApiTestWin.exe: platform=win32 208 $(out)/ApiTestWin.exe: gui=win32 209 $(out)/ApiTestWin.exe: module.rc=$(src)/ApiTestWin.rc 210 $(out)/ApiTestWin.exe: module.def=$(src)/ApiTestWin.def 211 $(out)/ApiTestWin.exe: cc.flags.defines=-DNULL=0 212 $(out)/ApiTestWin.exe: $(out)/ApiTestWin.obj 213 214 clean: 215 $(nl) 216 @echo [$@] 217 rm -rf -v $(out) 218 # rm -f -v *.objdump *.o *.obj *.coff *.omf *.ors *.res *.elf *.exe 219 220 221 else 222 223 1 224 #! GENINFO :: platform:OS/2, version:20.45, target:ApiTest.generate 2 225 ############################################################################### … … 42 265 # # 43 266 ############################################################################### 267 268 ifdef __OLD_METHOD__ 269 $(error OLD) 270 endif 44 271 45 272 # … … 60 287 SELF:=$(lastword $(MAKEFILE_LIST)) 61 288 289 # Prevent Make from deleting intermediate targets 290 .SECONDARY: 291 62 292 # This is the true default target invoked when no targets are specified. 63 293 # Because only one target can be specified, we redirect to a target called … … 67 297 .DEFAULT_GOAL:=default 68 298 69 # Use 'wl.exe' for linking 70 export EMXOMFLD_TYPE=wlink 71 export EMXOMFLD_LINKER=wl.exe 72 73 # The header, source and output directories relative to this Makefile 299 # The header, resources, source and output dirs relative to this Makefile 74 300 inc=h 301 rcsrc=rcsrc 75 302 src=src 76 303 out=out 304 305 # Include the toolchain wrappers and target building rules 306 include toolchains.gmi 307 include patternrules.gmi 308 309 # Create the output directory 310 $(shell $(md) $(out)) 311 $(info created output-directory: '$(out)') 77 312 78 313 # Accumulate Open Watcom Include Directories and compose a ';' separated … … 119 354 # This macro is invoked by defined but not yet implemented targets 120 355 define target.not.implemented 121 @echo !!! Target "$@" is not implemented yet... !!! 122 endef 123 124 # Display an empty line 125 define nl 126 echo. 356 @echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 357 @echo !!! Unhandled Target "$@" invoked 358 @echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 127 359 endef 128 360 … … 332 564 # ! At least the '/' bug with regard to the source specification seems to be 333 565 # ! fixed as of 'owcc' "Version 2.0 beta Apr 27 2014 22:48:31 (32-bit)". 566 # ! Update: Using owcc to link also experiences '/'-bug for opening .obj-files. 334 567 335 568 … … 337 570 # Build the Pm32 target executable (LX) 338 571 # ----------------------------------------------------------------------------- 339 $(out)/ApiTestPm.exe: $(s ubst /,\,$(src)/ApiTestPm.cpp)$(out)/ApiTestPm.res $(module.def)572 $(out)/ApiTestPm.exe: $(src)$/ApiTestPm.cpp $(out)/ApiTestPm.res $(module.def) 340 573 @echo [$@] 341 574 $(cc) $(cc.flags.sys) $(cc.flags.pre) $(cc.flags.incdirs) $(cc.flags.libdirs) $(cc.flags.libs) $(cc.flags.post) $(cc.defines) $< -o $@ … … 348 581 $(out)/ApiTestPm.res: $(src)/ApiTestPm.rc 349 582 @echo [$@] 350 @if not exist $(out) mkdir $(out)351 583 wrc -q -r -bt=os2 -zm -fo=$@ $< 352 584 … … 355 587 # Build the Odin32 target executable (LX) 356 588 # ----------------------------------------------------------------------------- 357 $(out)/ApiTestOdin.exe: $(s ubst /,\,$(src)/ApiTestOdin.cpp)$(out)/ApiTestOdin.ors $(module.def)589 $(out)/ApiTestOdin.exe: $(src)$/ApiTestOdin.cpp $(out)/ApiTestOdin.ors $(module.def) 358 590 @echo [$@] 359 591 $(cc) $(cc.flags.sys) $(cc.flags.pre) $(cc.flags.incdirs) $(cc.flags.libdirs) $(cc.flags.libs) $(cc.flags.post) $(cc.defines) $< -o $@ … … 375 607 $(out)/ApiTestOdin.ors: $(src)/ApiTestOdin.rc 376 608 @echo [$@] 377 @if not exist $(out) mkdir $(out)378 609 winerc -D__WIN32OS2__ -s $(cc.flags.incdirs) -I$(src) $< -o $(basename $@).s 379 610 as -Zomf $(basename $@).s -o $@ … … 397 628 wrc -q -r -bt=nt -zm -fo=$@ $< 398 629 630 # ------------------------------------------------------------ [ApiTestWin.ors] 631 # Compile the Win32 resources to binary form 632 # ----------------------------------------------------------------------------- 633 #$(out)/ApiTestWin.ors: $(src)/ApiTestWin.rc 634 # @echo [$@] 635 ## @if not exist $(out) mkdir $(out) 636 ### winerc -D__WIN32OS2__ -s $(cc.flags.incdirs) -I$(src) $< -o $(basename $@).s 637 ### as -Zomf $(basename $@).s -o $@ 638 # $(rc) $(src)/$(modulename).rc -O coff -o $(@) 399 639 400 640 # --------------------------------------------------------------------- [build] … … 474 714 $(out)\ApiTestWin.exe 475 715 716 # ----------------------------------------------------- [run.win32.mingw32msvc] 717 # Run the Win32 variant under Wine 718 # ----------------------------------------------------------------------------- 719 run.win32.mingw32msvc: mingw32msvc.build.win32 720 @echo [$@] 721 wine $(out)/ApiTestWin.exe 476 722 477 723 # ----------------------------------------------------------- [gen.tools.flags] … … 495 741 rm -rf -v $(out) 496 742 # rd $(out) 743 744 endif
Note:
See TracChangeset
for help on using the changeset viewer.
