1# Visual C++ 2.x, 4.x and 5.0 makefile for jpeg
2# adapted from suns example makefile (related to the TCL script language)
3#
4# CVS:  $Id: makefile.vc,v 1.3 1997/02/17 17:07:52 aku Exp $
5
6
7# Does not depend on the presence of any environment variables in
8# order to compile jpeg; all needed information is derived from
9# location of the compiler directories.
10
11#
12# Project directories
13#
14# ROOT    = top of source tree
15#
16# TMPDIR  = location where .obj files should be stored during build
17#
18# TOOLS32 = location of VC++ 32-bit development tools. Note that the
19#           VC++ 2.0 header files are broken, so you need to use the
20#           ones that come with the developer network CD's, or later
21#           versions of VC++.
22#
23
24VC_VERSION = 50
25
26ROOT            = .
27TMPDIR          = .
28!IF $(VC_VERSION) < 50
29TOOLS32 	= c:\msdev			# VC++ 2.x and 4.x
30!ELSE
31TOOLS32 	= c:\PROGRA~1\DevStudio\VC	# VC++ 5.0
32!ENDIF
33INSTALLDIR	= c:\WINNT\SYSTEM32
34
35# Set this to the appropriate value of /MACHINE: for your platform
36MACHINE = IX86
37
38# Comment the following line to compile with symbols
39NODEBUG=1
40
41
42######################################################################
43# Do not modify below this line
44######################################################################
45
46JPEG            =       jpeg62
47JPEGLIB         =       $(JPEG).lib
48JPEGDLL         =       $(JPEG).dll
49
50JPEGOBJS        =       \
51	$(TMPDIR)\jcapimin.obj  \
52	$(TMPDIR)\jcapistd.obj  \
53	$(TMPDIR)\jccoefct.obj  \
54	$(TMPDIR)\jccolor.obj   \
55	$(TMPDIR)\jcdctmgr.obj  \
56	$(TMPDIR)\jchuff.obj    \
57	$(TMPDIR)\jcinit.obj    \
58	$(TMPDIR)\jcmainct.obj  \
59	$(TMPDIR)\jcmarker.obj  \
60	$(TMPDIR)\jcmaster.obj  \
61	$(TMPDIR)\jcomapi.obj   \
62	$(TMPDIR)\jcparam.obj   \
63	$(TMPDIR)\jcphuff.obj   \
64	$(TMPDIR)\jcprepct.obj  \
65	$(TMPDIR)\jcsample.obj  \
66	$(TMPDIR)\jctrans.obj   \
67	$(TMPDIR)\jdapimin.obj  \
68	$(TMPDIR)\jdapistd.obj  \
69	$(TMPDIR)\jdatadst.obj  \
70	$(TMPDIR)\jdatasrc.obj  \
71	$(TMPDIR)\jdcoefct.obj  \
72	$(TMPDIR)\jdcolor.obj   \
73	$(TMPDIR)\jddctmgr.obj  \
74	$(TMPDIR)\jdhuff.obj    \
75	$(TMPDIR)\jdinput.obj   \
76	$(TMPDIR)\jdmainct.obj  \
77	$(TMPDIR)\jdmarker.obj  \
78	$(TMPDIR)\jdmaster.obj  \
79	$(TMPDIR)\jdmerge.obj   \
80	$(TMPDIR)\jdphuff.obj   \
81	$(TMPDIR)\jdpostct.obj  \
82	$(TMPDIR)\jdsample.obj  \
83	$(TMPDIR)\jdtrans.obj   \
84	$(TMPDIR)\jerror.obj    \
85	$(TMPDIR)\jfdctflt.obj  \
86	$(TMPDIR)\jfdctfst.obj  \
87	$(TMPDIR)\jfdctint.obj  \
88	$(TMPDIR)\jidctflt.obj  \
89	$(TMPDIR)\jidctfst.obj  \
90	$(TMPDIR)\jidctint.obj  \
91	$(TMPDIR)\jidctred.obj  \
92	$(TMPDIR)\jmemmgr.obj   \
93	$(TMPDIR)\jmemnobs.obj  \
94	$(TMPDIR)\jquant1.obj   \
95	$(TMPDIR)\jquant2.obj   \
96	$(TMPDIR)\jutils.obj
97
98
99PATH=$(TOOLS32)\bin;$(PATH)
100
101cc32            = $(TOOLS32)\bin\cl.exe
102link32          = $(TOOLS32)\bin\link.exe
103rc32            = $(TOOLS32)\bin\rc.exe
104include32       = -I$(TOOLS32)\include
105CP              = copy
106RM              = del
107
108JPEG_INCLUDES   = -I$(ROOT)
109JPEG_DEFINES    = -nologo -D__WIN32__ -DJPEG_DLL
110
111JPEG_CFLAGS     =       $(cdebug) $(cflags) $(cvarsdll) $(include32) \
112			$(JPEG_INCLUDES) $(JPEG_DEFINES)
113CON_CFLAGS      =       $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE
114DOS_CFLAGS      =       $(cdebug) $(cflags) $(include16) -AL
115
116######################################################################
117# Link flags
118######################################################################
119
120!IFDEF NODEBUG
121ldebug = /RELEASE
122!ELSE
123ldebug = -debug:full -debugtype:cv
124!ENDIF
125
126# declarations common to all linker options
127lcommon = /NODEFAULTLIB /RELEASE /NOLOGO
128
129# declarations for use on Intel i386, i486, and Pentium systems
130!IF "$(MACHINE)" == "IX86"
131DLLENTRY = @12
132lflags   = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE)
133!ELSE
134lflags   = $(lcommon) /MACHINE:$(MACHINE)
135!ENDIF
136
137conlflags = $(lflags) -subsystem:console -entry:mainCRTStartup
138guilflags = $(lflags) -subsystem:windows -entry:WinMainCRTStartup
139dlllflags = $(lflags) -entry:_DllMainCRTStartup$(DLLENTRY) -dll
140
141!IF "$(MACHINE)" == "PPC"
142libc = libc.lib
143libcdll = crtdll.lib
144!ELSE
145libc = libc.lib oldnames.lib
146libcdll = msvcrt.lib oldnames.lib
147!ENDIF
148
149baselibs   = kernel32.lib $(optlibs) advapi32.lib
150winlibs    = $(baselibs) user32.lib gdi32.lib comdlg32.lib winspool.lib
151
152guilibs    = $(libc) $(winlibs)
153conlibs    = $(libc) $(baselibs)
154guilibsdll = $(libcdll) $(winlibs)
155conlibsdll = $(libcdll) $(baselibs)
156
157######################################################################
158# Compile flags
159######################################################################
160
161!IFDEF NODEBUG
162cdebug = -Ox -Oy- -Gs -GD
163!ELSE
164cdebug = -Z7 -Od -WX
165!ENDIF
166
167# declarations common to all compiler options
168ccommon = -c -W3 -nologo -YX -Dtry=__try -Dexcept=__except
169
170# NEED BYTEORDER INFORMATION HERE !!
171!IF "$(MACHINE)" == "IX86"
172cflags = $(ccommon) -D_X86_=1
173!ELSE
174!IF "$(MACHINE)" == "MIPS"
175cflags = $(ccommon) -D_MIPS_=1
176!ELSE
177!IF "$(MACHINE)" == "PPC"
178cflags = $(ccommon) -D_PPC_=1
179!ELSE
180!IF "$(MACHINE)" == "ALPHA"
181cflags = $(ccommon) -D_ALPHA_=1
182!ENDIF
183!ENDIF
184!ENDIF
185!ENDIF
186
187cvars      = -DWIN32 -D_WIN32
188cvarsmt    = $(cvars) -D_MT
189cvarsdll   = $(cvarsmt) -D_DLL
190
191######################################################################
192# Project specific targets
193######################################################################
194
195release:    $(JPEGDLL)
196all:        $(JPEGDLL)
197
198install:        $(JPEGDLL)
199	-@md    $(INSTALLDIR)
200	-@$(CP) $(JPEGDLL)              $(INSTALLDIR)
201
202
203
204$(JPEGDLL): $(JPEGOBJS)
205	$(link32) $(ldebug) $(dlllflags) \
206		$(guilibsdll) -out:$(JPEGDLL) $(JPEGOBJS)
207
208
209#
210# Implicit rules
211#
212
213{$(ROOT)}.c{$(TMPDIR)}.obj:
214    $(cc32) $(JPEG_CFLAGS) -Fo$(TMPDIR)\ $<
215
216
217clean:
218	-@del *.exp
219	-@del *.lib
220	-@del *.dll
221	-@del $(TMPDIR)\*.obj
222	-@del *.pch
223	-@del *.pdb
224