# $Id: makefile.win32,v 1.1 2008/10/07 17:19:26 stulleamgym Exp $
#
# Win32 makefile for id3lib
#
# First off, copy config.h.win32 to config.h
#
# You should run this using 'name -f makefile.win32' from the
# id3lib root directory (for instance, c:\projects\id3lib-3.8.0\).
#
# If you want a debug version of the lib, add DEBUG=1 to 
# the nmake command line.
#
# The library will be produced as 'id3lib.lib' for the release
# version, or 'id3libd.lib' for the debug version.
#
# Comments, bugs, go to johan@linkdata.se
# Mail me on how to run the command line compiler, and I'll flame you. RTFM.
#
# PS.
# Wtf is it that everyone insists on using the Visual C++ IDE?
# I mean, I found the instructions for building this lib under
# the IDE posted on a mailing list. It was 4 pages long, at least.
#

CFLAGS=-nologo -I. -Iinclude -Iinclude\id3 -Izlib\include \
	-W3 -WX -GX \
	-DHAVE_CONFIG_H -DID3LIB_LINKOPTION=1

!ifdef DEBUG
SUFFIX=d
CFLAGS=$(CFLAGS) -Od -Z7 -Oy- -MD -D "WIN32" -D "_DEBUG"
!else
SUFFIX=
CFLAGS=$(CFLAGS) -Ox     -Oy- -MD -D "WIN32" -D "NDEBUG"
!endif

SRCDIR=src
ZLIBDIR=zlib\src
OBJDIR=obj$(SUFFIX)

SRCS=\
	$(SRCDIR)\c_wrapper.cpp \
	$(SRCDIR)\field.cpp \
	$(SRCDIR)\field_binary.cpp \
	$(SRCDIR)\field_integer.cpp \
	$(SRCDIR)\field_string_ascii.cpp \
	$(SRCDIR)\field_string_unicode.cpp \
	$(SRCDIR)\frame.cpp \
	$(SRCDIR)\frame_impl.cpp \
	$(SRCDIR)\frame_parse.cpp \
	$(SRCDIR)\frame_render.cpp \
	$(SRCDIR)\globals.cpp \
	$(SRCDIR)\header.cpp \
	$(SRCDIR)\header_frame.cpp \
	$(SRCDIR)\header_tag.cpp \
	$(SRCDIR)\helpers.cpp \
	$(SRCDIR)\io.cpp \
	$(SRCDIR)\io_decorators.cpp \
	$(SRCDIR)\io_helpers.cpp \
	$(SRCDIR)\misc_support.cpp \
	$(SRCDIR)\mp3_parse.cpp \
	$(SRCDIR)\readers.cpp \
	$(SRCDIR)\spec.cpp \
	$(SRCDIR)\tag.cpp \
	$(SRCDIR)\tag_file.cpp \
	$(SRCDIR)\tag_find.cpp \
	$(SRCDIR)\tag_impl.cpp \
	$(SRCDIR)\tag_parse.cpp \
	$(SRCDIR)\tag_parse_lyrics3.cpp \
	$(SRCDIR)\tag_parse_musicmatch.cpp \
	$(SRCDIR)\tag_parse_v1.cpp \
	$(SRCDIR)\tag_render.cpp \
	$(SRCDIR)\utils.cpp \
	$(SRCDIR)\writers.cpp \
	$(ZLIBDIR)\adler32.c \
	$(ZLIBDIR)\compress.c \
	$(ZLIBDIR)\crc32.c \
	$(ZLIBDIR)\deflate.c \
	$(ZLIBDIR)\gzio.c \
	$(ZLIBDIR)\infblock.c \
	$(ZLIBDIR)\infcodes.c \
	$(ZLIBDIR)\inffast.c \
	$(ZLIBDIR)\inflate.c \
	$(ZLIBDIR)\inftrees.c \
	$(ZLIBDIR)\infutil.c \
	$(ZLIBDIR)\trees.c \
	$(ZLIBDIR)\uncompr.c \
	$(ZLIBDIR)\zutil.c

OBJS=\
	$(OBJDIR)\c_wrapper.obj \
	$(OBJDIR)\field.obj \
	$(OBJDIR)\field_binary.obj \
	$(OBJDIR)\field_integer.obj \
	$(OBJDIR)\field_string_ascii.obj \
	$(OBJDIR)\field_string_unicode.obj \
	$(OBJDIR)\frame.obj \
	$(OBJDIR)\frame_impl.obj \
	$(OBJDIR)\frame_parse.obj \
	$(OBJDIR)\frame_render.obj \
	$(OBJDIR)\globals.obj \
	$(OBJDIR)\header.obj \
	$(OBJDIR)\header_frame.obj \
	$(OBJDIR)\header_tag.obj \
	$(OBJDIR)\helpers.obj \
	$(OBJDIR)\io.obj \
	$(OBJDIR)\io_decorators.obj \
	$(OBJDIR)\io_helpers.obj \
	$(OBJDIR)\misc_support.obj \
	$(OBJDIR)\mp3_parse.obj \
	$(OBJDIR)\readers.obj \
	$(OBJDIR)\spec.obj \
	$(OBJDIR)\tag.obj \
	$(OBJDIR)\tag_file.obj \
	$(OBJDIR)\tag_find.obj \
	$(OBJDIR)\tag_impl.obj \
	$(OBJDIR)\tag_parse.obj \
	$(OBJDIR)\tag_parse_lyrics3.obj \
	$(OBJDIR)\tag_parse_musicmatch.obj \
	$(OBJDIR)\tag_parse_v1.obj \
	$(OBJDIR)\tag_render.obj \
	$(OBJDIR)\utils.obj \
	$(OBJDIR)\writers.obj \
	$(OBJDIR)\adler32.obj \
	$(OBJDIR)\compress.obj \
	$(OBJDIR)\crc32.obj \
	$(OBJDIR)\deflate.obj \
	$(OBJDIR)\gzio.obj \
	$(OBJDIR)\infblock.obj \
	$(OBJDIR)\infcodes.obj \
	$(OBJDIR)\inffast.obj \
	$(OBJDIR)\inflate.obj \
	$(OBJDIR)\inftrees.obj \
	$(OBJDIR)\infutil.obj \
	$(OBJDIR)\trees.obj \
	$(OBJDIR)\uncompr.obj \
	$(OBJDIR)\zutil.obj

{$(SRCDIR)}.cpp{$(OBJDIR)}.obj:
	@if not exist $(OBJDIR) md $(OBJDIR)
	@$(CC) $(CFLAGS) -Fo$*.obj -c $(SRCDIR)\$(*F).cpp

{$(ZLIBDIR)}.c{$(OBJDIR)}.obj:
	@if not exist $(OBJDIR) md $(OBJDIR)
	@$(CC) $(CFLAGS) -Fo$*.obj -c $(ZLIBDIR)\$(*F).c

id3lib$(SUFFIX).lib : $(OBJS)
	@lib /nologo /out:id3lib$(SUFFIX).lib $(OBJS)
