environ.mif

来自「开放源码的编译器open watcom 1.6.0版的源代码」· MIF 代码 · 共 552 行

MIF
552
字号
#
# C compiler test environment
#

#
# configuration flags (default: flag symbol not defined)
#
# no_continue = yes     -- continue in the face of errors
# dev = yes             -- use development tools
# use_dll = yes         -- use !loaddll

#
# configuration values:
#
# targ_env_386 = wnt386/d4g386/os2386/linux386 (depends on current OS)
# targ_env_i86 = os2i86/dosi86 (depends on current OS)
# targ_env_axp = ntaxp (depends on current OS)
# targ_env_ppc = linuxppc/ntppc (depends on current OS)
# targ_env_mps = linuxmips (depends on current OS)
#
# nb: above directories can have extensions:
#   .    - Intel 386 hosted compiler
#   .axp - Digital AXP hosted compiler
#   ( more to be defined )
#
# wcc_386 = wcc386
# wcc_i86 = wcc
# wcc_axp = wccaxp
# wcc_ppc = wccppc
# wcc_mps = wccmps
# wpp_386 = wpp386
# wpp_i86 = wpp
# wpp_axp = wppaxp
# wpp_ppc = wppppc
# wpp_mps = wppmps
# dll_i86 = wppdi86.dll
# dll_386 = wppd386.dll
# dll_axp = wppdaxp.dll
# dll_ppc = wppdppc.dll
# dll_mps = wppdmps.dll
# arch = 386/axp/ppc/mps (depends on current hardware)
# linker = wlink
# log_file = $(ctest_dir)/$(ctest_name).log

#
# use ctest_* environment vars to set make variables
#
!ifndef dev
!  ifdef %ctest_dev
!    define dev $+$(%ctest_dev)$-
!  endif
!endif

!ifndef use_dll
!  ifdef %ctest_use_dll
!    define use_dll $+$(%ctest_use_dll)$-
!  endif
!endif

!ifndef wpp_386
!  ifdef %ctest_wpp_386
!    define wpp_386 $(%ctest_wpp_386)
!  endif
!endif

!ifndef wpp_i86
!  ifdef %ctest_wpp_i86
!    define wpp_i86 $(%ctest_wpp_i86)
!  endif
!endif

!ifndef wpp_axp
!  ifdef %ctest_wpp_axp
!    define wpp_axp $(%ctest_wpp_axp)
!  endif
!endif

!ifndef wpp_ppc
!  ifdef %ctest_wpp_ppc
!    define wpp_ppc $(%ctest_wpp_ppc)
!  endif
!endif

!ifndef wpp_mps
!  ifdef %ctest_wpp_mps
!    define wpp_mps $(%ctest_wpp_mps)
!  endif
!endif

!ifndef dll_386
!  ifdef %ctest_dll_386
!    define dll_386 $(%ctest_dll_386)
!  endif
!endif

!ifndef dll_i86
!  ifdef %ctest_dll_i86
!    define dll_i86 $(%ctest_dll_i86)
!  endif
!endif

!ifndef dll_axp
!  ifdef %ctest_dll_axp
!    define dll_axp $(%ctest_dll_axp)
!  endif
!endif

!ifndef targ_env_386
!  ifdef %ctest_targ_env_386
!    define targ_env_386 $(%ctest_targ_env_386)
!  endif
!endif

!ifndef targ_env_i86
!  ifdef %ctest_targ_env_i86
!    define targ_env_i86 $(%ctest_targ_env_i86)
!  endif
!endif

!ifndef targ_env_axp
!  ifdef %ctest_targ_env_axp
!    define targ_env_axp $(%ctest_targ_env_axp)
!  endif
!endif

!ifndef targ_env_ppc
!  ifdef %ctest_targ_env_ppc
!    define targ_env_ppc $(%ctest_targ_env_ppc)
!  endif
!endif

!ifndef targ_env_mps
!  ifdef %ctest_targ_env_mps
!    define targ_env_mps $(%ctest_targ_env_mps)
!  endif
!endif

!ifndef ctest_name
!error macro 'ctest_name' has not been set
!endif

.extensions:
.extensions: .exp .exe .obj .sbj .2bj .3bj .ser .err .c .cc .cpp .mif
.mif: ..;$(mif_path)

!ifndef no_continue
.continue
!else
!  ifneq no_continue yes
.continue
!  endif
!endif

.erase

#
# architectures -- 386, i86, axp, ppc, mps
#
!ifndef arch
!   ifdef __NTAXP__
!       define arch axp
!   else ifdef __LINUXPPC__
!       define arch ppc
!   else ifdef __LINUXMIPS__
!       define arch mps
!   else
!       define arch 386
!   endif
!endif

#
# 386 environments
#
# pls386 -- PharLap .EXP
# d4g386 -- DOS4G .EXE
# tnt386 -- PharLap TNT .EXE
# os2386 -- OS/2 2.x .EXE
# lnx386 -- Linux x86 executable
# wnt386 -- Windows NT x86 .EXE
#

#
# i86 environments
#
# dosi86 -- DOS .EXE
# os2i86 -- OS/2 1.x .EXE
#

#
# Alpha AXP environments
#
# wntaxp -- Windows NT Alpha AXP .EXE
#

#
# PowerPC environments
#
# lnxppc -- Linux PowerPC executable
#

#
# MIPS environments
#
# lnxmps -- Linux MIPS executable
#
!ifndef targ_env_386
!  ifdef __DOS__
!    define targ_env_386 d4g386
!  else ifdef __OS2__
!    define targ_env_386 os2386
!  else ifdef __LINUX__
!    define targ_env_386 lnx386
!  else ifdef __NT386__
!    define targ_env_386 wnt386
!  endif
!endif

!ifndef targ_env_i86
!  ifdef __DOS__
!    define targ_env_i86 dosi86
!  else ifdef __OS2__
!    define targ_env_i86 os2i86
!  else ifdef __NT__
!    define targ_env_i86 wnti86
!  endif
!endif

!ifndef targ_env_axp
!  ifdef __DOS__
!    define targ_env_axp dosaxp
!  else ifdef __OS2__
!    define targ_env_axp os2axp
!  else ifdef __NT__
!    define targ_env_axp wntaxp
!  endif
!endif

!ifndef targ_env_mps
!  ifdef __LINUX__
!    define targ_env_mps lnxmps
!  endif
!endif

#
# targ_run      name of executable loader (e.g., run386)
targ_run_pls386 = run386
targ_run_d4g386 = dos4gw
targ_run_tnt386 = tntrun
targ_run_os2386 =
targ_run_wnt386 =
targ_run_lnx386 =
targ_run_wnti86 =
targ_run_dosi86 =
targ_run_os2i86 =
targ_run_wntaxp =
targ_run_lnxppc =
targ_run_lnxmps =

run_386 = $(targ_run_$(targ_env_386))
run_i86 = $(targ_run_$(targ_env_i86))
run_axp = $(targ_run_$(targ_env_axp))
run_ppc = $(targ_run_$(targ_env_ppc))
run_mps = $(targ_run_$(targ_env_mps))

run = $(run_$(arch))

#
# targ_ext      extension (e.g., exp ) - must have one for default rules to work
targ_ext_pls386 = exp
targ_ext_d4g386 = exe
targ_ext_tnt386 = exe
targ_ext_os2386 = exe
targ_ext_wnt386 = exe
targ_ext_lnx386 = exe

ext_386 = $(targ_ext_$(targ_env_386))
ext_i86 = exe
ext_axp = exe
ext_ppc = exe
ext_mps = exe

exe = $(ext_$(arch))

#
# targ_lnk      linker directives (e.g., system pharlap option offset=64k)
targ_lnk_pls386 = system pharlap option offset=64k
targ_lnk_d4g386 = system dos4g
targ_lnk_tnt386 = system nt option offset=64k
targ_lnk_os2386 = system os2v2 option offset=64k
targ_lnk_wnt386 = system nt option offset=64k
targ_lnk_lnx386 = system bld_linux
!ifdef __NT386__
targ_lnk_wnti86 = system dos option stack=3k
!else
targ_lnk_wnti86 = system os2 pmc libpath $(watcom_dir)\lib
!endif
targ_lnk_dosi86 = system dos option stack=3k
targ_lnk_os2i86 = system os2 pmc libpath $(watcom_dir)\lib
targ_lnk_wntaxp = system ntaxp
targ_lnk_lnxppc = system bld_linuxppc
targ_lnk_lnxmps = system bld_linuxmips

lnk_any    = # option noundefsok # add once we only use 11.0 linkers

lnk_386 = $(targ_lnk_$(targ_env_386)) $(lnk_any)
lnk_i86 = $(targ_lnk_$(targ_env_i86)) $(lnk_any)
lnk_axp = $(targ_lnk_$(targ_env_axp)) $(lnk_any)
lnk_ppc = $(targ_lnk_$(targ_env_ppc)) $(lnk_any)
lnk_mps = $(targ_lnk_$(targ_env_mps)) $(lnk_any)

#
# targ_ldb      linker debug directive (e.g., DEBUG all)
targ_ldb_pls386 = debug all
targ_ldb_d4g386 = debug all
targ_ldb_tnt386 = debug all
targ_ldb_os2386 = debug all
targ_ldb_wnt386 = debug all
targ_ldb_lnx386 = debug all
targ_ldb_wnti86 = debug all
targ_ldb_dosi86 = debug all
targ_ldb_os2i86 = debug all
targ_ldb_wntaxp = debug codeview
targ_ldb_lnxppc = debug all
targ_ldb_lnxmps = debug all

ldebug_386 = $(targ_ldb_$(targ_env_386))
ldebug_i86 = $(targ_ldb_$(targ_env_i86))
ldebug_axp = $(targ_ldb_$(targ_env_axp))
ldebug_ppc = $(targ_ldb_$(targ_env_ppc))
ldebug_mps = $(targ_ldb_$(targ_env_mps))

#
# targ_bld      build options (e.g., -bt=dos)
targ_bld_pls386 = -bt=dos
targ_bld_d4g386 = -bt=dos
targ_bld_tnt386 = -bt=nt
targ_bld_os2386 = -bt=os2
targ_bld_wnt386 = -bt=nt
targ_bld_lnx386 = -bt=linux
!ifdef __NT386__
targ_bld_wnti86 = -bt=dos
!else
targ_bld_wnti86 = -bt=nt
!endif
targ_bld_dosi86 = -bt=dos
targ_bld_os2i86 = -bt=os2
#
# these will be empty
#
targ_bld_wntaxp = -si

#
# build environment
#
!ifndef wcc_386
wcc_386 = wcc386 $(targ_bld_$(targ_env_386))
!endif
!ifndef wcc_i86
wcc_i86 = wcc $(targ_bld_$(targ_env_i86))
!endif
!ifndef wcc_axp
wcc_axp = wccaxp $(targ_bld_$(targ_env_axp))
!endif
!ifndef wcc_ppc
wcc_ppc = wccppc $(targ_bld_$(targ_env_ppc))
!endif
!ifndef wcc_mps
wcc_mps = wccmps $(targ_bld_$(targ_env_mps))
!endif

!ifndef wpp_386
!  ifdef dev
!    ifdef __DOS__
!      define wpp_386 run386 $(plusplus_dir)\dos386\wcpp386d
!    else ifdef __OS2__
!      define wpp_386 $(plusplus_dir)\os2386\wcpp386d
!    else ifdef __LINUX__
!      define wpp_386 $(plusplus_dir)/linux386/wcpp386d
!    else ifdef __NT386__
!      define wpp_386 $(plusplus_dir)\nt386\wcpp386d
!    else ifdef __NTAXP__
!      define wpp_386 $(plusplus_dir)\nt386.axp\wcpp386d
!    endif
!  else
!    define wpp_386 wpp386
!  endif
!endif
!ifndef wpp_i86
!  ifdef dev
!    ifdef __DOS__
!      define wpp_i86 run386 $(plusplus_dir)\dosi86\wcppi86d
!    else ifdef __OS2__
!      define wpp_i86 $(plusplus_dir)\os2i86\wcppi86d
!    else ifdef __LINUX__
!      define wpp_i86 $(plusplus_dir)/linuxi86/wcppi86d
!    else ifdef __NT386__
!      define wpp_i86 $(plusplus_dir)\nti86\wcppi86d
!    else ifdef __NTAXP__
!      define wpp_i86 $(plusplus_dir)\nti86.axp\wcppi86d
!    endif
!  else
!    define wpp_i86 wpp
!  endif
!endif
!ifndef wpp_axp
!  ifdef dev
!    ifdef __DOS__
!      define wpp_axp run386 $(plusplus_dir)\dosaxp\wcppaxpd
!    else ifdef __OS2__
!      define wpp_axp $(plusplus_dir)\os2axp\wcppaxpd
!    else ifdef __NT386__
!      define wpp_axp $(plusplus_dir)\ntaxp\wcppaxpd
!    else ifdef __NTAXP__
!      define wpp_axp $(plusplus_dir)\ntaxp.axp\wcppaxpd
!    endif
!  else
!    define wpp_axp wppaxp
!  endif
!endif

!ifndef dll_386
!  ifdef dev
!    ifdef __OS2__
!      define dll_386 $(plusplus_dir)\os2386\wppd386d.dll
!    else ifdef __NT386__
!      define dll_386 $(plusplus_dir)\nt386\wppd386d.dll
!    else ifdef __NTAXP__
!      define dll_386 $(plusplus_dir)\nt386.axp\wppd386d.dll
!    endif
!  else
!    define dll_386 wppd386.dll
!  endif
!endif
!ifndef dll_i86
!  ifdef dev
!    ifdef __OS2__
!      define dll_i86 $(plusplus_dir)\os2i86\wppdi86d.dll
!    else ifdef __NT386__
!      define dll_i86 $(plusplus_dir)\nti86\wppdi86d.dll
!    else ifdef __NTAXP__
!      define dll_i86 $(plusplus_dir)\nti86.axp\wppdi86d.dll
!    endif
!  else
!    define dll_i86 wppdi86.dll
!  endif
!endif
!ifndef dll_axp
!  ifdef dev
!    ifdef __OS2__
!      define dll_axp $(plusplus_dir)\os2axp\wppdaxpd.dll
!    else ifdef __NT386__
!      define dll_axp $(plusplus_dir)\ntaxp\wppdaxpd.dll
!    else ifdef __NTAXP__
!      define dll_axp $(plusplus_dir)\ntaxp.axp\wppdaxpd.dll
!    endif
!  else
!    define dll_axp wppdaxp.dll
!  endif
!endif

!ifdef dll_loaded
!  undef dll_loaded
!endif

!ifdef use_dll
!  define dll_loaded
!  loaddll $(wpp_$(arch)) $(dll_$(arch))
!endif

# add architecture common options
wpp_386 += $(targ_bld_$(targ_env_386))
wpp_i86 += $(targ_bld_$(targ_env_i86))
wpp_axp += $(targ_bld_$(targ_env_axp))
wpp_ppc += $(targ_bld_$(targ_env_ppc))
wpp_mps += $(targ_bld_$(targ_env_mps))

#
# MAKEINIT vars
#
proj_name = ctest
host_cpu = $(arch)
!ifdef __MSDOS__
!  define host_os dos
!else ifdef __OS2__
!  define host_os os2
!else ifdef __NT__
!  define host_os
!else ifdef __LINUX__
!  define host_os linux
!else
!  error unknown OS
!endif
!include cproj.mif

#
# linker
#
!ifdef %ctest_linker
!  define linker $+$(%ctest_linker)$-
!else
!  ifndef linker
!    define linker wlink
!  endif
!  ifdef use_dll
!    loaddll wlink wlink.dll
!  endif
!endif

#
# output log file location
#
!ifndef log_file
!  ifdef %ctest_log_file
!    define log_file $+$(%ctest_log_file)$-
!  else ifdef %ctest_name
!    define log_file $(ctest_dir)/$+$(%ctest_name)$-.log
!  else
!    define log_file $(ctest_dir)/$(ctest_name).log
!  endif
!endif

first_target : .symbolic start test
    @%null

start : .symbolic
!ifdef dll_loaded
    @echo using !loaddll $(dll_$(arch))
!endif
    @cdsay
    @cdsay >> $(log_file)

clean : .symbolic global
    @%null

common_clean : .symbolic
    @if exist *.?bj rm *.?bj
    @if exist *.err rm *.err
    @if exist *.lnk rm *.lnk
    @if exist *.lbc rm *.lbc
    @if exist *.$(exe) rm *.$(exe)
    @if exist *.dll rm *.dll
    @if exist *.out rm *.out
    @if exist *.sym rm *.sym
    @if exist *.dmp rm *.dmp
    @if exist *.map rm *.map
    @if exist *.lst rm *.lst
    @if exist *.log rm *.log
    @if exist *.pdb rm *.pdb
    @if exist *.pch rm *.pch
    @if exist *.lib rm *.lib
    @if exist *.res rm *.res

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?