!ifndef IMPLICIT_RULES_DEFINED
IMPLICIT_RULES_DEFINED=
#
# Implicit rules for building object files.
#
.cpp.o16:
    $(D16_COMPILER) $(D16_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -fo=$*.o16 $<

.cpp.o32:
	$(D32_COMPILER) $(D32_COMPILE_OPTIONS) -fo=$*.o32 $<

.c.o32:
	$(D32_C_COMPILER) $(D32_COMPILE_OPTIONS) -fo=$*.o32 $<

.cpp.ob1:
	$(W16_COMPILER) $(W16_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -fo=$*.ob1 $<

.cpp.obw:
	$(W32_COMPILER) $(W32_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -fo=$*.obw $<

.cpp.obx:
	$(W32_COMPILER) $(W32_DLL_EXPORT_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -fo=$*.obx $<

.cpp.obi:
	$(W32_COMPILER) $(W32_DLL_IMPORT_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -fo=$*.obi $<

.rc.r16:
	$(W16_RESOURCE_COMPILER) $(W16_RESOURCE_OPTIONS) -r -fo$*.r16 $<

.rc.res:
	$(W32_RESOURCE_COMPILER) $(W32_RESOURCE_OPTIONS) -r $<
!endif

OBJECT_FILES_LINK=$(OBJECT_FILES_LINK: =, )
OBJECT_FILES_LIB=$(OBJECT_FILES_LIB: = +)
LIBRARIES_LINK=$(LIBRARIES: =, )

#
# Explicit rule for building executables.
#
!if "$(TARGET_TYPE)" == "EXE" || "$(TARGET_TYPE)" == "EXEDLL"
$(TARGET): $(DEPENDENCY_FILES) $(RES_FILE)
	$(LINKER) $(LINK_OPTIONS) @<<
NA $< FI $(OBJECT_FILES_LINK) LI $(LIBRARIES_LINK)
<<
# Uncomment these lines for binding DOS4GW into the executable.
#!if "$(PLATFORM)" == "DOS32"
#	$(D32_BIND) $(D32_DOS4GW_DIR)\$(D32_LOAD) $* $*.exb
#	del $*.exe
#	ren $*.exb $*.exe
#!endif
!endif

#
# Explicit rule for building DLL's
#
!if "$(TARGET_TYPE)" == "DLL"
$(TARGET): $(DEPENDENCY_FILES) $(RES_FILE)
	$(LINKER) N $< $(LINK_OPTIONS) libr $(LIBRARIES_LINK) @<<
File $(OBJECT_FILES_LINK)
<<
	-@del $(IMPORT_LIBRARY)
	$(LIBRARIAN) -n -b zafw32i.lib +zafw32.dll
!endif

#
# Explicit rule for building libraries.
#
!if "$(TARGET_TYPE)" == "LIB" || "$(TARGET_TYPE)" == "LIBDLL"
$(TARGET): $(DEPENDENCY_FILES)
	-@del $(TARGET)
	$(LIBRARIAN) $(LIBRARY_OPTIONS) $(TARGET) @<<
+$(OBJECT_FILES_LIB)
<<
!endif

