The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
# Visual C++ 2.x and 4.0 makefile for jpeg
# adapted from suns example makefile (related to the TCL script language)
#
# CVS:  $Id: makefile.vc,v 1.3 1997/02/17 17:07:52 aku Exp $


# Does not depend on the presence of any environment variables in
# order to compile jpeg; all needed information is derived from 
# location of the compiler directories.

#
# Project directories
#
# ROOT    = top of source tree
#
# TMPDIR  = location where .obj files should be stored during build
#
# TOOLS32 = location of VC++ 32-bit development tools. Note that the
#           VC++ 2.0 header files are broken, so you need to use the
#           ones that come with the developer network CD's, or later
#           versions of VC++.
#

ROOT            = .
TMPDIR          = .
TOOLS32         = c:\msdev

# Set this to the appropriate value of /MACHINE: for your platform
MACHINE = IX86

# Comment the following line to compile with symbols
NODEBUG=1


######################################################################
# Do not modify below this line
######################################################################

JPEG            =       jpeg
JPEGLIB         =       $(JPEG).lib
JPEGDLL         =       $(JPEG).dll

JPEGOBJS        =       \
	$(TMPDIR)\cdjpeg.obj    \
	$(TMPDIR)\ckconfig.obj  \
	$(TMPDIR)\jcapimin.obj  \
	$(TMPDIR)\jcapistd.obj  \
	$(TMPDIR)\jccoefct.obj  \
	$(TMPDIR)\jccolor.obj   \
	$(TMPDIR)\jcdctmgr.obj  \
	$(TMPDIR)\jchuff.obj    \
	$(TMPDIR)\jcinit.obj    \
	$(TMPDIR)\jcmainct.obj  \
	$(TMPDIR)\jcmarker.obj  \
	$(TMPDIR)\jcmaster.obj  \
	$(TMPDIR)\jcomapi.obj   \
	$(TMPDIR)\jcparam.obj   \
	$(TMPDIR)\jcphuff.obj   \
	$(TMPDIR)\jcprepct.obj  \
	$(TMPDIR)\jcsample.obj  \
	$(TMPDIR)\jctrans.obj   \
	$(TMPDIR)\jdapimin.obj  \
	$(TMPDIR)\jdapistd.obj  \
	$(TMPDIR)\jdatadst.obj  \
	$(TMPDIR)\jdatasrc.obj  \
	$(TMPDIR)\jdcoefct.obj  \
	$(TMPDIR)\jdcolor.obj   \
	$(TMPDIR)\jddctmgr.obj  \
	$(TMPDIR)\jdhuff.obj    \
	$(TMPDIR)\jdinput.obj   \
	$(TMPDIR)\jdmainct.obj  \
	$(TMPDIR)\jdmarker.obj  \
	$(TMPDIR)\jdmaster.obj  \
	$(TMPDIR)\jdmerge.obj   \
	$(TMPDIR)\jdphuff.obj   \
	$(TMPDIR)\jdpostct.obj  \
	$(TMPDIR)\jdsample.obj  \
	$(TMPDIR)\jdtrans.obj   \
	$(TMPDIR)\jerror.obj    \
	$(TMPDIR)\jfdctflt.obj  \
	$(TMPDIR)\jfdctfst.obj  \
	$(TMPDIR)\jfdctint.obj  \
	$(TMPDIR)\jidctflt.obj  \
	$(TMPDIR)\jidctfst.obj  \
	$(TMPDIR)\jidctint.obj  \
	$(TMPDIR)\jidctred.obj  \
	$(TMPDIR)\jmemmgr.obj   \
	$(TMPDIR)\jmemnobs.obj  \
	$(TMPDIR)\jquant1.obj   \
	$(TMPDIR)\jquant2.obj   \
	$(TMPDIR)\jutils.obj    \
	$(TMPDIR)\rdbmp.obj     \
	$(TMPDIR)\rdcolmap.obj  \
	$(TMPDIR)\rdgif.obj     \
	$(TMPDIR)\rdppm.obj     \
	$(TMPDIR)\rdrle.obj     \
	$(TMPDIR)\rdswitch.obj  \
	$(TMPDIR)\rdtarga.obj   \
	$(TMPDIR)\wrbmp.obj     \
	$(TMPDIR)\wrgif.obj     \
	$(TMPDIR)\wrppm.obj     \
	$(TMPDIR)\wrrle.obj     \
	$(TMPDIR)\wrtarga.obj


PATH=$(TOOLS32)\bin;$(PATH)

cc32            = $(TOOLS32)\bin\cl.exe
link32          = $(TOOLS32)\bin\link.exe
rc32            = $(TOOLS32)\bin\rc.exe
include32       = -I$(TOOLS32)\include
CP              = copy
RM              = del

JPEG_INCLUDES   = -I$(ROOT)
JPEG_DEFINES    = -nologo -D__WIN32__ -DJPEG_DLL

JPEG_CFLAGS     =       $(cdebug) $(cflags) $(cvarsdll) $(include32) \
			$(JPEG_INCLUDES) $(JPEG_DEFINES)
CON_CFLAGS      =       $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
DOS_CFLAGS      =       $(cdebug) $(cflags) $(include16) -AL 

######################################################################
# Link flags
######################################################################

!IFDEF NODEBUG
ldebug = /RELEASE
!ELSE
ldebug = -debug:full -debugtype:cv
!ENDIF

# declarations common to all linker options
lcommon = /NODEFAULTLIB /RELEASE /NOLOGO

# declarations for use on Intel i386, i486, and Pentium systems
!IF "$(MACHINE)" == "IX86"
DLLENTRY = @12
lflags   = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
!ELSE
lflags   = $(lcommon) /MACHINE:$(MACHINE)
!ENDIF

conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll

!IF "$(MACHINE)" == "PPC"
libc = libc.lib
libcdll = crtdll.lib
!ELSE
libc = libc.lib oldnames.lib
libcdll = msvcrt.lib oldnames.lib
!ENDIF

baselibs   = kernel32.lib $(optlibs) advapi32.lib
winlibs    = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib

guilibs    = $(libc) $(winlibs)
conlibs    = $(libc) $(baselibs)
guilibsdll = $(libcdll) $(winlibs)
conlibsdll = $(libcdll) $(baselibs)

######################################################################
# Compile flags
######################################################################

!IFDEF NODEBUG
cdebug = -Ox
!ELSE
cdebug = -Z7 -Od -WX
!ENDIF

# declarations common to all compiler options
ccommon = -c -W3 -nologo -YX -Dtry=__try -Dexcept=__except

# NEED BYTEORDER INFORMATION HERE !!
!IF "$(MACHINE)" == "IX86"
cflags = $(ccommon) -D_X86_=1
!ELSE
!IF "$(MACHINE)" == "MIPS"
cflags = $(ccommon) -D_MIPS_=1
!ELSE
!IF "$(MACHINE)" == "PPC"
cflags = $(ccommon) -D_PPC_=1
!ELSE
!IF "$(MACHINE)" == "ALPHA"
cflags = $(ccommon) -D_ALPHA_=1
!ENDIF
!ENDIF
!ENDIF
!ENDIF

cvars      = -DWIN32 -D_WIN32
cvarsmt    = $(cvars) -D_MT
cvarsdll   = $(cvarsmt) -D_DLL

######################################################################
# Project specific targets
######################################################################

release:    $(JPEGDLL)
all:        $(JPEGDLL)

install:        $(JPEGDLL)
	-@md    $(INSTALLDIR)
	-@$(CP) $(JPEGDLL)              $(INSTALLDIR)



$(JPEGDLL): $(JPEGOBJS)
	$(link32) $(ldebug) $(dlllflags) \
		$(guilibsdll) -out:$(JPEGDLL) $(JPEGOBJS)


#
# Implicit rules
#

{$(ROOT)}.c{$(TMPDIR)}.obj:
    $(cc32) $(JPEG_CFLAGS) -Fo$(TMPDIR)\ $<


clean:
	-@del *.exp 
	-@del *.lib 
	-@del *.dll 
	-@del $(TMPDIR)\*.obj
	-@del *.pch
	-@del *.pdb