#############################################################################
#
#                   Copyright (C) 1996 SciTech Software
#                           All rights reserved.
#
# Descripton:   Generic makefile for the MGL version of the JPEG image
#               library.
#
# $Date:   27 Sep 1997 17:39:36  $ $Author:   KendallB  $
#
#############################################################################

# DOS extender dependant flags

CFLAGS          += $(DX_CFLAGS)
ASFLAGS         += $(DX_ASFLAGS)

# Name of library file. Note that the DLL version is intended for Delphi

.IF $(BUILD_DLL)
CFLAGS          += -DBUILD_DLL
DLLFILE         = mgljpeg$D
LIBFILE         = mgljpeg$L
.ELSE
.IF $(STKCALL)
LIBFILE         = sjpeg$L
.ELSE
LIBFILE         = jpeg$L
.ENDIF
.ENDIF
LIBCLEAN        = mgljpeg.lib jpeg.lib sjpeg.lib jpeg.a

# library object files common to compression and decompression
COMOBJECTS      = jcomapi$O jutils$O jerror$O jmemmgr$O jmemmgl$O

# compression library object files
CLIBOBJECTS		= jcapimin$O jcapistd$O jctrans$O jcparam$O jdatadst$O 		\
				  jcinit$O jcmaster$O jcmarker$O jcmainct$O jcprepct$O 		\
				  jccoefct$O jccolor$O jcsample$O jchuff$O jcphuff$O 		\
				  jcdctmgr$O jfdctfst$O jfdctflt$O jfdctint$O

# decompression library object files
DLIBOBJECTS		= jdapimin$O jdapistd$O jdtrans$O jdatasrc$O 				\
				  jdmaster$O jdinput$O jdmarker$O jdhuff$O jdphuff$O 		\
				  jdmainct$O jdcoefct$O jdpostct$O jddctmgr$O jidctfst$O 	\
				  jidctflt$O jidctint$O jidctred$O jdsample$O jdcolor$O		\
				  jquant1$O jquant2$O jdmerge$O

# These objectfiles are included in libjpeg.lib
OBJECTS			= $(CLIBOBJECTS) $(DLIBOBJECTS) $(COMOBJECTS)

# Define the list of object files to create dependency information for

DEPEND_OBJ      = $(OBJECTS) $(COBJECTS) $(DOBJECTS) $(TROBJECTS)

.INCLUDE: "$(SCITECH)\makedefs\common.mk"

# Target to build all DOS 32-bit libraries
#
# NOTE: We have to build the jdmerge object file with Borland C++ 5.0,
# 		since it fails with an internal cimpiler error for Borland C++
#		4.52. The rest of the code compiles just fine.

.SWAP .PHONY mkdos32:
	@+build wc10-d32 install -u OPT=1
	@+build wc11-d32 install -u OPT=1
	@+dmake cleanexe
	@+build bc50-d32 jdmerge.obj -u OPT=1
	@+build bc45-d32 install OPT=1
	@+build dj20-d32 install -u OPT=1

# Target to build all DOS libraries

.PHONY mkdos: mkdos32 cleanexe

# Target to build Windows 32-bit DLL's

.SWAP .PHONY mkdll32:
    @+build bc50-w32 install -u BUILD_DLL=1 OPT=1

# Target to build all win 32-bit libraries.
#
# NOTE: We have to build the jdmerge object file with Borland C++ 5.0,
# 		since it fails with an internal cimpiler error for Borland C++
#		4.52. The rest of the code compiles just fine.

.SWAP .PHONY mkwin32:
	@+build wc10-w32 install -u OPT=1
	@+build wc11-w32 install -u OPT=1
	@+dmake cleanexe
	@+build bc50-w32 jdmerge.obj -u OPT=1
	@+build bc45-w32 install OPT=1
	@+build bc50-w32 install -u OPT=1
	@+build vc40-w32 install -u OPT=1
	@+build vc50-w32 install -u OPT=1

# Target to build all Windows libraries

.PHONY mkwin: mkwin32 mkdll32 cleanexe

# Target to build all libraries

.PHONY mkall: mkdos32 mkwin32 mkdll32 cleanexe
