#
# This file is a user contribution and is not supported by Zinc.
#

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

.cpp.ob1:
	$(W16_COMPILER) $(W16_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -c -o$*.ob1 $<

.cpp.obw:
	$(W32_COMPILER) $(W32_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -c -o$*.obw $<

.cpp.obx:
	$(W32_COMPILER) $(W32_DLL_EXPORT_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -c -o$*.obx $<

.cpp.obi:
	$(W32_COMPILER) $(W32_DLL_IMPORT_COMPILE_OPTIONS) $(DEBUG_COMPILE_OPTIONS) -c -o$*.obi $<

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

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


OBJECT_FILES_LIB=$(OBJECT_FILES_LIB: =+)

#
# Explicit rule for building executables.
#
!if "$(TARGET_TYPE)" == "EXE" || "$(TARGET_TYPE)" == "EXEDLL"
$(TARGET): $(DEPENDENCY_FILES) $(RES_FILE)
	$(LINKER) $(LINK_OPTIONS) @<<
$(OBJECT_FILES_LINK)
$*, , $(LIBRARIES), $(DEFINITION_FILE), $(RES_FILE)
<<
!endif

#
# Explicit rule for building DLL's
#
!if "$(TARGET_TYPE)" == "DLL"
$(TARGET): $(DEPENDENCY_FILES) $(RES_FILE)
	$(LINKER) $(LINK_OPTIONS) @<<
$(OBJECT_FILES_LINK)
$*, , $(LIBRARIES), $(DEFINITION_FILE), $(RES_FILE)
<<
	-@del $(IMPORT_LIBRARY)
	implib $(IMPORT_LIBRARY) $(TARGET)
!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
