cproj.mif

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

MIF
465
字号
!include preclude.mif

!ifndef lang_root
lang_root       = $(lang_root_$(host_cpu))
!endif

!ifeq %BUILDMODE bootstrap
bootstrapmode = 1
!else ifdef %OWLINUXBUILD
bootstrapmode = 1
!endif

cc_386          = *wcc386
cc_i86          = *wcc
cc_axp          = *wccaxp
cc_ppc          = *wccppc
cc_mps          = *wccmps

cl_386          = *wcl386
cl_i86          = *wcl
cl_axp          = *wclaxp
cl_ppc          = *wclppc
cl_mps          = *wclmps

cpp_386         = *wpp386
cpp_i86         = *wpp
cpp_axp         = *wppaxp
cpp_ppc         = *wppppc
cpp_mps         = *wppmps

linker_386      = *wlink
linker_i86      = *wlink
linker_axp      = *wlink
linker_ppc      = *wlink
linker_mps      = *wlink

librarian_386   = *wlib
librarian_i86   = *wlib
librarian_axp   = *wlib
librarian_ppc   = *wlib
librarian_mps   = *wlib

as_386          = *wasm
as_i86          = *wasm
as_axp          = *wasaxp
as_ppc          = *wasppc
as_mps          = *wasmps

rc              = *wrc
rcaui           = *wrc


!ifdef $(proj_name)_release
release = $($(proj_name)_release)
!else ifeq debug_build 1
release = 0
!else
release = 1
!endif

!ifdef $(proj_name)_debugfmt
debugfmt = $($(proj_name)_debugfmt)
!else ifeq %CODEVIEW 1
debugfmt = codeview
!else
debugfmt = dwarf
!endif

!ifeq debugfmt codeview
cdebug_fmt  = -hc
ldebug_fmt  = debug codeview
cldebug_fmt = -hc
!else ifeq debugfmt watcom # supported only on intel
cdebug_fmt  = -hw          # cg for axp and ppc don't use it
ldebug_fmt  = debug watcom
cldebug_fmt = -hw
!else
#cdebug_fmt  = -hd              # default format
ldebug_fmt  = debug dwarf
cldebug_fmt = -hd
!endif

mode_libflags =
!ifeq release 1
mode_cflags   = -oaxt -d1-DNDEBUG $(cdebug_fmt)
mode_aflags   = -DNDEBUG
mode_lflags   = $(ldebug_fmt)
mode_clflags  = $(cldebug_fmt)
!ifdef $(proj_name)_distrib_lib
mode_libflags = -s-t
!endif
!else
mode_cflags   = -od -d2 $(cdebug_fmt)
mode_aflags   = -d1
mode_lflags   = $(ldebug_fmt) all
mode_clflags  = $(cldebug_fmt)
!endif

!ifndef $(proj_name)_nosymfile
mode_lflags    += option symfile
!ifdef __UNIX__
mode_clflags   += -\"option symfile\"
!else
mode_clflags   += -"option symfile"
!endif
!endif

!ifndef memory_model_i86
memory_model_i86 = l
!endif
model_switch_i86 = -m$(memory_model_i86)

default_memory_model_386_dos   = s
default_memory_model_386_qnx   = s
default_memory_model_386_nov   = s
default_memory_model_386_osi   = s
default_memory_model_386_win   = f
default_memory_model_386_os2   = f
default_memory_model_386_nt    = f
default_memory_model_386_linux = f
default_memory_model_386_      = f

!ifndef memory_model_386
memory_model_386 = $(default_memory_model_386_$(host_os))
!endif
model_switch_386 = -m$(memory_model_386)

!ifdef __UNIX__
cflags_all      =-w4 -we $(mode_cflags) -fo=.obj
!else
cflags_all      =-w4 -we $(mode_cflags)
!endif

cflags_386      = $(model_switch_$(host_cpu))
cflags_i86      = $(model_switch_$(host_cpu))
cflags_axp      =
cflags_ppc      =
cflags_mps      =

!ifndef suppress_zc
cflags_386      += -zc
!endif

cflags_nt       = -bt=nt
cflags_win      = -bt=windows -DSTRICT
cflags_os2      = -bt=os2
cflags_qnx      = -bt=qnx
cflags_osi      = -bt=osi
cflags_dos      = -bt=dos
cflags_nov      = -bt=netware
cflags_linux    = -bt=linux

!ifdef $(proj_name)_rtdll
!ifeq $(proj_name)_rtdll 1
sys_rtdll       = 1
!else
sys_rtdll       = 0
!endif
!endif

!ifndef sys_rtdll
sys_rtdll       = 0
!endif

!ifeq sys_rtdll 1
cflags_nt      += -br
cflags_win     += -br
cflags_os2     += -br
!endif

######################
# DEFAULT FPU SETINGS
######
  # DOS doesn't have emulator support, but OW has it
  # must be -fpc or -fpi
def_fpu_flags_dos_i86   = -fpi
  ######
  # OS/2 ????
def_fpu_flags_os2_i86   = -fpi
  ######
  # Windows 3.x has emulator support (WIN87EM.DLL)
  # must be -fpc or -fpi, don't use -fpi87
def_fpu_flags_win_i86   = -fpi
  ######
  # QNX doesn't have emulator support, but OW has it
  # must be -fpc or -fpi
def_fpu_flags_qnx_i86   = -fpi
  ######
  # Extenders don't have emulator support
  # must be -fpc or -fpi
def_fpu_flags_dos_386   = -fpi
  ######
  # OS/2 ????
def_fpu_flags_os2_386   = -fpi
  ######
  # OW 386 Windows extender has 387 emulator support
def_fpu_flags_win_386   = -fpi
  ######
  # QNX doesn't have emulator support, but OW has it
def_fpu_flags_qnx_386   = -fpi
  ######
  # WIN32 systems have emulator support in kernel
def_fpu_flags_nt_386    = -fpi
  ######
  # LINUX has emulator support in kernel
def_fpu_flags_linux_386 = -fpi
  ######
  # NOVELL ?????
def_fpu_flags_nov_386   = -fpc
  ######
  # should be compatible with all 386 platforms
  # I ignore Novell seting
  # I think Novell doesn't use any OSI objects
def_fpu_flags_osi_386   = -fpi
  ######

!ifdef fpu_flags_$(host_os)_$(host_cpu)
fpu_flags = $(fpu_flags_$(host_os)_$(host_cpu))
!else
fpu_flags = $(def_fpu_flags_$(host_os)_$(host_cpu))
!endif

clflags_nt_386     = -l=nt
clflags_nt_axp     = -l=ntaxp
clflags_win_i86    = -l=windows -DSTRICT
clflags_win_386    = -l=windows -DSTRICT
clflags_os2_i86    = -l=os2
clflags_os2_386    = -l=os2v2
clflags_qnx_i86    = -l=qnx
clflags_qnx_386    = -l=qnx
clflags_osi_386    = -l=osi
clflags_dos_i86    = -l=dos
clflags_dos_386    = -l=dos4g
clflags_nov_386    = -l=netware
!ifdef bootstrapmode
clflags_linux_386  = -l=bld_linux
clflags_linux_ppc  = -l=bld_linuxppc
clflags_linux_mps  = -l=bld_linuxmips
!else
clflags_linux_386  = -l=linux
clflags_linux_ppc  = -l=linuxppc
clflags_linux_mps  = -l=linuxmips
!endif

clflags_exe_osi_386 = -fe=$^&.rex
!ifdef clflags_exe_$(host_os)_$(host_cpu)
clflags_exe = $(clflags_exe_$(host_os)_$(host_cpu))
!else
clflags_exe = -fe=$@
!endif

proj_c_flags     = $(extra_c_flags) $(extra_c_flags_$(host_cpu)) $(extra_c_flags_$(host_os))
cflags           = $(cflags_all) $(fpu_flags) $(cflags_$(host_cpu)) $(cflags_$(host_os)) $(cflags_$(host_os)_$(host_cpu)) $(proj_c_flags)
proj_cpp_flags   = $(extra_cpp_flags) $(extra_cpp_flags_$(host_cpu)) $(extra_cpp_flags_$(host_os))
cppflags         = $(cppflags_all) $(proj_cpp_flags)
clflags          = $(mode_clflags) $(clflags_$(host_os)_$(host_cpu)) $(model_switch_$(host_cpu)) $(extra_cl_flags) $(clflags_exe) -fm

aflags_all      =

!ifdef __UNIX__
aflags_386      = -3-w4-fo=.obj
aflags_i86      = -w4-fo=.obj
aflags_axp      = -we-fo=.obj
aflags_ppc      = -we-fo=.obj
aflags_mps      = -we-fo=.obj
!else
aflags_386      = -3-w4
aflags_i86      = -w4
aflags_axp      = -we
aflags_ppc      = -we
aflags_mps      = -we
!endif

aflags_nt       = -bt=nt
aflags_win      = -bt=windows
aflags_os2      = -bt=os2
aflags_qnx      = -bt=qnx
aflags_osi      = -bt=osi
aflags_dos      = -bt=dos
aflags_nov      = -bt=netware
aflags_linux    = -bt=linux

proj_a_flags     = $(extra_a_flags) $(extra_a_flags_$(host_cpu)) $(extra_a_flags_$(host_os))
aflags           = $(aflags_all) $(aflags_$(host_cpu)) $(aflags_$(host_os)) $(mode_aflags) $(proj_a_flags)

lflags_dos_i86   = sys dos
lflags_nt_axp    = sys ntaxp
lflags_nt_386    = sys nt
lflags_os2_386   = sys os2v2
lflags_os2_i86   = sys os2 pmc
lflags_dos_386   = sys dos4g
lflags_qnx_386   = sys qnx386 flat
lflags_qnx_i86   = sys qnx
lflags_win_386   = sys win386
lflags_win_i86   = sys windows
lflags_nov_386   = sys novell
lflags_osi_386   = sys osi
!ifdef bootstrapmode
lflags_linux_386 = sys bld_linux
lflags_linux_ppc = sys bld_linuxppc
lflags_linux_mps = sys bld_linuxmips
!else
lflags_linux_386 = sys linux
lflags_linux_ppc = sys linuxppc
lflags_linux_mps = sys linuxmips
!endif

lflags_dll_nt_axp    = sys ntaxp dll
lflags_dll_nt_386    = sys nt dll
lflags_dll_os2_386   = sys os2v2 dll
lflags_dll_os2_i86   = sys os2 dll
lflags_dll_win_i86   = sys windows dll

!ifdef sys_windowed
# this is really stupid
lflags_nt_386   = sys nt_win
lflags_nt_axp   = sys ntaxp_win
lflags_os2_386  = sys os2v2_pm
lflags_os2_i86  = sys os2_pm
!endif
!ifdef sys_dll
#this is equally bad
lflags_nt_386   = sys nt_dll
lflags_nt_axp   = sys ntaxp_dll
lflags_win_i86  = sys windows_dll
lflags_os2_386  = sys os2v2 dll
lflags_os2_i86  = sys os2 dll
!ifndef suppress_bd
cflags_all     += -bd
!endif
!endif

lflags          = $(mode_lflags) $(lflags_$(host_os)_$(host_cpu)) $(extra_l_flags_$(host_os)) $(extra_l_flags)
lflags_dll      = $(mode_lflags) $(lflags_dll_$(host_os)_$(host_cpu)) $(extra_l_flags_dll_$(host_os)) $(extra_l_flags_dll)

libflags_all    = -b-n $(mode_libflags)
libflags        =  $(libflags_all) $(libflags_$(host_os)_$(host_cpu)) $(extra_lib_flags) $(extra_lib_flags_$(host_cpu))

rc_flags_nt     = -bt=nt
rc_flags_win    = -bt=windows
rc_flags_os2    = -bt=os2

rc_flags_axp    = -D__AXP__

rc_flags        = $(rc_flags_$(host_os)) $(rc_flags_$(host_cpu)) $(extra_rc_flags) $(extra_rc_flags_$(host_os))

!ifdef __UNIX__

!ifdef bootstrapmode

inc_dirs_sys_os2_386 = -I$(dev_dir)/os2api/incl32
inc_dirs_sys_os2_i86 = -I$(dev_dir)/os2api/incl16
inc_dirs_sys_nt    = -I$(dev_dir)/w32api/include
inc_dirs_sys_win   = -I$(dev_dir)/w16api/include
inc_dirs_sys_os2   = $(inc_dirs_sys_os2_$(host_cpu))
inc_dirs_sys_dos   =
inc_dirs_sys_nov   =
inc_dirs_sys_qnx   =
inc_dirs_sys_linux =
inc_dirs_sys_nto   =

inc_dirs_lang_osi     = -I$(hdr_dir)/dos
inc_dirs_lang_qnx     = -I$(hdr_dir)/qnx
inc_dirs_lang_linux   = -I$(hdr_dir)/linux
inc_dirs_lang_netware = -I$(ow_nwoss_root)/common/h
inc_dirs_lang_nto     = -I$(hdr_dir)/nto

!ifdef inc_dirs_lang_$(host_os)
inc_dirs_lang   = $(inc_dirs_lang_$(host_os))
!else
inc_dirs_lang   = -I$(hdr_dir)/dos
!endif

!else

inc_dirs_sys_os2_386 = -I$(lang_root)/h/os2
inc_dirs_sys_os2_i86 = -I$(lang_root)/h/os21x
inc_dirs_sys_nt    = -I$(lang_root)/h/nt
inc_dirs_sys_win   = -I$(lang_root)/h/win
inc_dirs_sys_os2   = $(inc_dirs_sys_os2_$(host_cpu))
inc_dirs_sys_dos   =
inc_dirs_sys_nov   =
inc_dirs_sys_qnx   =
inc_dirs_sys_linux =
inc_dirs_sys_nto   =

inc_dirs_lang_qnx     = -I$(lang_root)/qh
inc_dirs_lang_linux   = -I$(lang_root)/lh
inc_dirs_lang_netware = -I$(ow_nwoss_root)/common/h
inc_dirs_lang_nto     = -I$(lang_root)/nto

!ifdef inc_dirs_lang_$(host_os)
inc_dirs_lang   = $(inc_dirs_lang_$(host_os))
!else
inc_dirs_lang   = -I$(lang_root)/h
!endif

!endif

inc_dirs_sys    = $(inc_dirs_lang) $(inc_dirs_sys_$(host_os))
inc_path        = $(inc_dirs) $(inc_dirs_$(host_os)) $(inc_dirs_sys) -I$(watcom_dir)/h

!else

inc_dirs_sys_os2_386 = -I$(lang_root)\h\os2
inc_dirs_sys_os2_i86 = -I$(lang_root)\h\os21x
inc_dirs_sys_nt    = -I$(lang_root)\h\nt
inc_dirs_sys_win   = -I$(lang_root)\h\win
inc_dirs_sys_os2   = $(inc_dirs_sys_os2_$(host_cpu))
inc_dirs_sys_dos   =
inc_dirs_sys_nov   =
inc_dirs_sys_qnx   =
inc_dirs_sys_linux =
inc_dirs_sys_nto   =

inc_dirs_lang_qnx     = -I$(lang_root)\qh
inc_dirs_lang_linux   = -I$(lang_root)\lh
inc_dirs_lang_netware = -I$(ow_nwoss_root)\common\h
inc_dirs_lang_nto     = -I$(lang_root)\nto

!ifdef inc_dirs_lang_$(host_os)
inc_dirs_lang   = $(inc_dirs_lang_$(host_os))
!else
inc_dirs_lang   = -I$(lang_root)\h
!endif

inc_dirs_sys    = $(inc_dirs_lang) $(inc_dirs_sys_$(host_os))
inc_path        = $(inc_dirs) $(inc_dirs_$(host_os)) $(inc_dirs_sys) -I$(watcom_dir)\h

!endif

rtdll_clib_os2_386     = $(rtdll_dir)/clib/os2.386/mf_r
rtdll_clib_nt_386      = $(rtdll_dir)/clib/winnt.386/mf_r

rtdll_mathlib_os2_386  = $(rtdll_dir)/mathlib/os2.386/mf_r
rtdll_mathlib_nt_386   = $(rtdll_dir)/mathlib/winnt.386/mf_r

rtdll_mathlib7_os2_386 = $(rtdll_dir)/mathlib/os2.387/mf_r
rtdll_mathlib7_nt_386  = $(rtdll_dir)/mathlib/winnt.387/mf_r

rtdll_cpplib_os2_386   = $(rtdll_dir)/cpplib/os2.386/mf_r
rtdll_cpplib_nt_386    = $(rtdll_dir)/cpplib/winnt.386/mf_r

rtdll_libpath = &
    $(rtdll_clib_$(host_os)_$(host_cpu)) &
    $(rtdll_mathlib_$(host_os)_$(host_cpu)) &
    $(rtdll_mathlib7_$(host_os)_$(host_cpu)) &
    $(rtdll_cpplib_$(host_os)_$(host_cpu))

cc              = $(cc_$(host_cpu))
cl              = $(cl_$(host_cpu))
cpp             = $(cpp_$(host_cpu))
linker          = $(linker_$(host_cpu))
librarian       = $(librarian_$(host_cpu))
as              = $(as_$(host_cpu))
vi              = vi -q -d -i
!ifdef __UNIX__
rc_aui          = $(rcaui) -bt=windows -I$(watcom_dir)/h -zk0 -r
!else
rc_aui          = $(rcaui) -bt=windows -I$(watcom_dir)\h -zk0 -r
!endif

!include bhost.mif
!include local.mif

⌨️ 快捷键说明

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