::BEGIN_COMMENT
#######################################################################
#   uiglobal.src - master copy of the build rules in uirules.mk and 
#   uioptseg.mk. WARNING: uirules.mk and uioptseg.mk are generated
#   automatically. Make changes here only.  
#   
#         NOTE: substitutions done after SED 
#               (see uiglobal section of makefile)
#
#                  |    uirules.mk      |    uioptseg.mk
#           -------|--------------------|-----------------
#            ::00  |    empty string    |       _00, _01, _02 ... 
#            ::11  |    empty string    |     empty, _00, _01 ...
#            ::22  |         bj         |        00,  01, ... 
#
#         NOTE: -NT$(SEG::22) will be deleted in uirules.mk
#
#   Pls record ALL changes here with reason!
#    t-yis, 6/20/91, created
#     The following temporary macros are used to get around the 
#     problem that in nmake, there are problems when you define
#     macros in terms of itself.
#
#        TMP_CXXSRC_THRU, TMP_CXXSRC_THRU_00, TMP_CXXSRC_THRU_01, ...
#            Accumulated C++ source files related to segment.
#            TMP_CXXSRC_THRU = $(CXXSRC_COMMON) $(CXXSRC_LM21) .....
#            TMP_CXXSRC_THRU_00 = $(TMP_CXXSRC_THRU) $(CXXSRC_COMMON_00)
#                                 $(CXXSRC_LM21_00) .....
#            TMP_CXXSRC_THRU_01 = $(TMP_CXXSRC_THRU) $(CXXSRC_COMMON_01)
#                                 $(CXXSRC_LM21_01) .....
#
#        TMP_CSRC_THRU, TMP_CSRC_THRU_00, TMP_CSRC_THRU_01, ...
#        TMP_OBJS_THRU, TMP_OBJS_THRU_00, TMP_OBJS_THRU_01, ...
#        TMP_WIN_OBJS_THRU, .....
#        TMP_OS2_OBJS_THRU, .....
#        TMP_DOS_OBJS_THRU, .....
# 
#        CXXSRC_ALL = $(TMP_CXXSRC_THRU) or $(TMP_CXXSRC_THRU_00) or
#                     $(TMP_CXXSRC_THRU_01) or..... depending on how many
#                     segments are used. 
#        Same thing applies to CSRC_ALL, OBJS_TMP, WIN_OBJS_TMP, 
#			       OS2_OBJS_TMP, DOS_OBJS_TMP
#
#    jonn, 10/17/91, updated
#	 Now always uses CCXX -> DEL -> MV -> CC strategy for C++ build
#    beng, 22-Oct-1991
#	 Fixed bug in Nmake macro usage
#    jonn, 11/03/91, updated
#	 Added suuport for RETAIN_C_INTERMEDIATE
#
#	Note that the DEL command must always be prefaced by the $(BINARIES_X)
#	macro, since NMAKE changes '\' to '/' but DEL will not acccept that.
#    jonn, 11/21/91, removed LM21/LM30 distinction
#    jonn, 11/27/91, updated
#	 Added support for NT-hosted build
#    jonn, 11/27/91, removed "-c"
#
#######################################################################
::END_COMMENT

::BEGIN_OPTSEG
####################### Rules for SEG::22 ###############################
!IFDEF SEG::22
.SUFFIXES : .o::22
::END_OPTSEG
::BEGIN_RULES
TMP_CXXSRC_THRU = 
TMP_CSRC_THRU = 
TMP_OBJS_THRU =
TMP_WIN_OBJS_THRU =
TMP_OS2_OBJS_THRU =
TMP_DOS_OBJS_THRU =
::END_RULES

TMP_CXXSRC_THRU::00 = $(TMP_CXXSRC_THRU::11) $(CXXSRC_COMMON::00) $(CXXSRC_WIN::00) $(CXXSRC_OS2::00) $(CXXSRC_DOS::00)

TMP_CSRC_THRU::00 = $(TMP_CSRC_THRU::11) $(CSRC_COMMON::00) $(CSRC_WIN::00) $(CSRC_OS2::00) $(CSRC_DOS::00)

CSRC_TMP::00 = $(CSRC_COMMON::00)
CXXSRC_TMP::00 = $(CXXSRC_COMMON::00)

TMP_OBJS_THRU::00 = $(TMP_OBJS_THRU::11) $(CXXSRC_TMP::00:.cxx=.o::22) $(CSRC_TMP::00:.c=.o::22)
TMP_WIN_OBJS_THRU::00 = $(TMP_WIN_OBJS_THRU::11) $(CXXSRC_WIN::00:.cxx=.o::22) $(CSRC_WIN::00:.c=.o::22)
TMP_OS2_OBJS_THRU::00 = $(TMP_OS2_OBJS_THRU::11) $(CXXSRC_OS2::00:.cxx=.o::22) $(CSRC_OS2::00:.c=.o::22)
TMP_DOS_OBJS_THRU::00 = $(TMP_DOS_OBJS_THRU::11) $(CXXSRC_DOS::00:.cxx=.o::22) $(CSRC_DOS::00:.c=.o::22)

CXXSRC_ALL = $(TMP_CXXSRC_THRU::00)
CSRC_ALL = $(TMP_CSRC_THRU::00)
OBJS_TMP = $(TMP_OBJS_THRU::00)
WIN_OBJS_TMP = $(TMP_WIN_OBJS_THRU::00)
OS2_OBJS_TMP = $(TMP_OS2_OBJS_THRU::00)
DOS_OBJS_TMP = $(TMP_DOS_OBJS_THRU::00)


# BUILD RULES

.cxx.o::22:
	!error .cxx.o::22 : Please build objects into $(BINARIES), $(BINARIES_WIN) or $(BINARIES_OS2)

{}.cxx{$(BINARIES)}.o::22:
!IFDEF C700
	$(CC) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<
!ELSE
!IFDEF NT_HOSTED
	$(CCXX) !t !o $(CXFLAGS) $(CINC) $< >$(BINARIES)\$(<B).cmd
	$(BINARIES)\$(<B).cmd
	-del $(BINARIES)\$(<B).cmd
!ELSE
	$(CCXX) $(CXFLAGS) $(CINC) $<
!ENDIF
	-del $(BINARIES)\$(<B).c
	@$(MV) $(<R).c $*.c
	$(CC) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $*.c
!IF DEFINED(RETAIN_ALL_INTERMEDIATE) || DEFINED(RETAIN_C_INTERMEDIATE)
	@echo Retained intermediate file $(BINARIES)\$(<B).c
!ELSE
	-del $(BINARIES)\$(<B).c
!ENDIF
!ENDIF

{}.cxx{$(BINARIES_WIN)}.o::22:
!IFDEF C700
	$(CC) $(WINFLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<
!ELSE
!IFDEF NT_HOSTED
	$(CCXX) !t !o $(WINFLAGS) $(CXFLAGS) $(CINC) $< >$(BINARIES_WIN)\$(<B).cmd
	$(BINARIES_WIN)\$(<B).cmd
	-del $(BINARIES_WIN)\$(<B).cmd
!ELSE
	$(CCXX) $(WINFLAGS) $(CXFLAGS) $(CINC) $<
!ENDIF
	-del $(BINARIES_WIN)\$(<B).c
	@$(MV) $(<R).c $*.c
	$(CC) $(WINFLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $*.c
!IF DEFINED(RETAIN_ALL_INTERMEDIATE) || DEFINED(RETAIN_C_INTERMEDIATE)
	@echo Retained intermediate file $(BINARIES_WIN)\$(<B).c
!ELSE
	-del $(BINARIES_WIN)\$(<B).c
!ENDIF
!ENDIF

{}.cxx{$(BINARIES_OS2)}.o::22:
!IFDEF C700
	$(CC) $(OS2FLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<
!ELSE
!IFDEF NT_HOSTED
	$(CCXX) !t !o $(OS2FLAGS) $(CXFLAGS) $(CINC) $< >$(BINARIES_OS2)\$(<B).cmd
	$(BINARIES_OS2)\$(<B).cmd
	-del $(BINARIES_OS2)\$(<B).cmd
!ELSE
	$(CCXX) $(OS2FLAGS) $(CXFLAGS) $(CINC) $<
!ENDIF
	-del $(BINARIES_OS2)\$(<B).c
	@$(MV) $(<R).c $*.c
	$(CC) $(OS2FLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $*.c
!IF DEFINED(RETAIN_ALL_INTERMEDIATE) || DEFINED(RETAIN_C_INTERMEDIATE)
	@echo Retained intermediate file $(BINARIES_OS2)\$(<B).c
!ELSE
	-del $(BINARIES_OS2)\$(<B).c
!ENDIF
!ENDIF

{}.cxx{$(BINARIES_DOS)}.o::22:
!IFDEF C700
	$(CC) $(DOSFLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<
!ELSE
!IFDEF NT_HOSTED
	$(CCXX) !t !o $(DOSFLAGS) $(CXFLAGS) $(CINC) $< >$(BINARIES_DOS)\$(<B).cmd
	$(BINARIES_DOS)\$(<B).cmd
	-del $(BINARIES_DOS)\$(<B).cmd
!ELSE
	$(CCXX) $(DOSFLAGS) $(CXFLAGS) $(CINC) $<
!ENDIF
	-del $(BINARIES_DOS)\$(<B).c
	@$(MV) $(<R).c $*.c
	$(CC) $(DOSFLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $*.c
!IF DEFINED(RETAIN_ALL_INTERMEDIATE) || DEFINED(RETAIN_C_INTERMEDIATE)
	@echo Retained intermediate file $(BINARIES_DOS)\$(<B).c
!ELSE
	-del $(BINARIES_DOS)\$(<B).c
!ENDIF
!ENDIF



{}.c{$(BINARIES)}.o::22:
     $(CC) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<

{}.c{$(BINARIES_WIN)}.o::22:
    $(CC) $(WINFLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<

{}.c{$(BINARIES_OS2)}.o::22:
    $(CC) $(OS2FLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<

{}.c{$(BINARIES_DOS)}.o::22:
    $(CC) $(DOSFLAGS) $(CFLAGS) -NT$(SEG::22) $(TARGET) $(CINC) $<


::BEGIN_OPTSEG
!ENDIF
::END_OPTSEG
