Makefile.vc: split mux into separate lib

similar to other builds, reusing some variable naming from
makefile.unix.
also change the main output file names to libwebp{,mux}.{lib,dll} with
the import lib retaining the _dll suffix.

Change-Id: I6bbc4fb39ab37957f153e9f31954387b24094581
This commit is contained in:
James Zern 2012-04-20 16:20:32 -07:00
parent 27caa5aa34
commit e2feefa9b8

View File

@ -1,18 +1,8 @@
# #
# Stem for static libs and DLLs # Stem for static libs and DLLs
# #
LIB_NAME = libwebp_a LIBWEBP_BASENAME = libwebp
LIB_NAME_DEBUG = libwebp_a_debug LIBWEBPMUX_BASENAME = libwebpmux
#
# Stem for DLL import libs
#
IMPLIB_NAME = libwebp_dll
IMPLIB_NAME_DEBUG = libwebp_dll_debug
!IFNDEF DEP_PATH
DEPS_PATH = ../../deps
!ENDIF
!IFNDEF ARCH !IFNDEF ARCH
!IF ! [ cl 2>&1 | find "x86" > NUL ] !IF ! [ cl 2>&1 | find "x86" > NUL ]
@ -66,7 +56,7 @@ DIROBJ = $(DIRBASE)\obj
DIRLIB = $(DIRBASE)\lib DIRLIB = $(DIRBASE)\lib
DIRINC = $(DIRBASE)\include DIRINC = $(DIRBASE)\include
DIRBIN = $(DIRBASE)\bin DIRBIN = $(DIRBASE)\bin
LIBPDBNAME = $(DIROBJ)\$(TARGET).pdb LIBWEBP_PDBNAME = $(DIROBJ)\$(LIBWEBP_BASENAME).pdb
OUTPUT_DIRS = $(DIRBIN) $(DIRINC) $(DIRLIB) \ OUTPUT_DIRS = $(DIRBIN) $(DIRINC) $(DIRLIB) \
$(DIROBJ)\dec \ $(DIROBJ)\dec \
$(DIROBJ)\dsp \ $(DIROBJ)\dsp \
@ -77,38 +67,38 @@ OUTPUT_DIRS = $(DIRBIN) $(DIRINC) $(DIRLIB) \
# Target configuration # Target configuration
!IF "$(CFG)" == "release-static" !IF "$(CFG)" == "release-static"
TARGET = $(LIB_NAME).lib
CC = $(CCNODBG) CC = $(CCNODBG)
STATICLIBBUILD = TRUE STATICLIBBUILD = TRUE
!ELSE IF "$(CFG)" == "debug-static" !ELSE IF "$(CFG)" == "debug-static"
TARGET = $(LIB_NAME_DEBUG).lib
CC = $(CCDEBUG) CC = $(CCDEBUG)
RTLIB = $(RTLIBD) RTLIB = $(RTLIBD)
STATICLIBBUILD = TRUE STATICLIBBUILD = TRUE
LIBWEBP_BASENAME = $(LIBWEBP_BASENAME)_debug
LIBWEBPMUX_BASENAME = $(LIBWEBPMUX_BASENAME)_debug
!ELSE IF "$(CFG)" == "release-dynamic" !ELSE IF "$(CFG)" == "release-dynamic"
TARGETDLL = $(LIB_NAME).dll
TARGET = $(IMPLIB_NAME).lib
CC = $(CCNODBG) CC = $(CCNODBG)
DLLBUILD = TRUE DLLBUILD = TRUE
!ELSE IF "$(CFG)" == "debug-dynamic" !ELSE IF "$(CFG)" == "debug-dynamic"
TARGETDLL = $(LIB_NAME_DEBUG).dll
TARGET = $(IMPLIB_NAME_DEBUG).lib
CC = $(CCDEBUG) CC = $(CCDEBUG)
RTLIB = $(RTLIBD) RTLIB = $(RTLIBD)
DLLBUILD = TRUE DLLBUILD = TRUE
LIBWEBP_BASENAME = $(LIBWEBP_BASENAME)_debug
LIBWEBPMUX_BASENAME = $(LIBWEBPMUX_BASENAME)_debug
!ENDIF !ENDIF
!IF "$(STATICLIBBUILD)" == "TRUE" !IF "$(STATICLIBBUILD)" == "TRUE"
CC = $(CC) $(RTLIB) CC = $(CC) $(RTLIB)
LNK = $(LNKLIB) /out:$(DIRLIB)\$(TARGET)
CFGSET = TRUE CFGSET = TRUE
LIBWEBP = $(DIRLIB)\$(LIBWEBP_BASENAME).lib
LIBWEBPMUX = $(DIRLIB)\$(LIBWEBPMUX_BASENAME).lib
!ELSE IF "$(DLLBUILD)" == "TRUE" !ELSE IF "$(DLLBUILD)" == "TRUE"
DLLC = webp_dll.c DLLC = webp_dll.c
DLLINC = webp_dll.h DLLINC = webp_dll.h
CC = $(CC) /I$(DIROBJ) /FI$(DLLINC) $(RTLIB) /DWEBP_DLL CC = $(CC) /I$(DIROBJ) /FI$(DLLINC) $(RTLIB) /DWEBP_DLL
LNK = $(LNKDLL) /out:$(DIRBIN)\$(TARGETDLL) /implib:$(DIRLIB)\$(TARGET) LIBWEBP = $(DIRLIB)\$(LIBWEBP_BASENAME)_dll.lib
X_OBJS = $(DIROBJ)\$(DLLC:.c=.obj) LIBWEBPMUX = $(DIRLIB)\$(LIBWEBPMUX_BASENAME)_dll.lib
LIBPDBNAME = $(DIROBJ)\$(TARGETDLL).pdb LIBWEBP_OBJS = $(DIROBJ)\$(DLLC:.c=.obj)
LIBWEBP_PDBNAME = $(DIROBJ)\$(LIBWEBP_BASENAME)_dll.pdb
CFGSET = TRUE CFGSET = TRUE
!ENDIF !ENDIF
@ -128,7 +118,7 @@ CFGSET = TRUE
!MESSAGE <target> may be: !MESSAGE <target> may be:
!MESSAGE - clean - perform a clean for CFG !MESSAGE - clean - perform a clean for CFG
!MESSAGE - experimental - build CFG with experimental !MESSAGE - experimental - build CFG with experimental
!MESSAGE . features enabled. Requires zlib. !MESSAGE . features enabled.
!MESSAGE - (empty) or all - build all targets for CFG !MESSAGE - (empty) or all - build all targets for CFG
!MESSAGE !MESSAGE
!MESSAGE RTLIBCFG controls the runtime library linkage - 'static' or 'dynamic'. !MESSAGE RTLIBCFG controls the runtime library linkage - 'static' or 'dynamic'.
@ -210,43 +200,48 @@ UTILS_OBJS = \
$(DIROBJ)\utils\rescaler.obj \ $(DIROBJ)\utils\rescaler.obj \
$(DIROBJ)\utils\thread.obj \ $(DIROBJ)\utils\thread.obj \
X_OBJS = $(DEC_OBJS) $(DSP_OBJS) $(ENC_OBJS) $(MUX_OBJS) $(UTILS_OBJS) $(X_OBJS) LIBWEBP_OBJS = $(DEC_OBJS) $(DSP_OBJS) $(ENC_OBJS) $(UTILS_OBJS) $(LIBWEBP_OBJS)
LIBWEBPMUX_OBJS = $(MUX_OBJS) $(LIBWEBPMUX_OBJS)
EXAMPLES_OBJS = \ OUT_LIBS = $(LIBWEBP) $(LIBWEBPMUX)
$(DIROBJ)\examples\cwebp.obj \ OUT_EXAMPLES = $(DIRBIN)\cwebp.exe $(DIRBIN)\dwebp.exe $(DIRBIN)\webpmux.exe
$(DIROBJ)\examples\dwebp.obj \
$(DIROBJ)\examples\webpmux.obj
all: $(DIRLIB)\$(TARGET) $(DIRBIN)\dwebp.exe $(DIRBIN)\cwebp.exe \ all: $(OUT_LIBS) $(OUT_EXAMPLES)
$(DIRBIN)\webpmux.exe $(DIRBIN)\cwebp.exe: $(DIROBJ)\examples\cwebp.obj
$(DIRBIN)\dwebp.exe: $(DIROBJ)\examples\dwebp.obj
$(DIRBIN)\webpmux.exe: $(DIROBJ)\examples\webpmux.obj $(LIBWEBPMUX)
$(OUT_EXAMPLES): $(EX_UTIL_OBJS) $(LIBWEBP)
# Additional include and library paths (for zlib) can be passed via the CL and
# LINK environment variables respectively:
# > set CL=/I\zlib\include
# > set LINK=\zlib\zlib.lib
# > nmake /f Makefile.vc CFG=release-static experimental
experimental: experimental:
$(MAKE) /f Makefile.vc \ $(MAKE) /f Makefile.vc \
CFG=$(CFG) \ CFG=$(CFG) \
CFLAGS="$(CFLAGS) /DWEBP_EXPERIMENTAL_FEATURES" /$(MAKEFLAGS) CFLAGS="$(CFLAGS) /DWEBP_EXPERIMENTAL_FEATURES" /$(MAKEFLAGS)
$(DIRLIB)\$(TARGET): $(X_OBJS) $(LIBWEBP): $(LIBWEBP_OBJS)
$(LNK) $(LFLAGS) $(X_OBJS) $(LIBWEBPMUX): $(LIBWEBPMUX_OBJS)
-xcopy $(DIROBJ)\*.pdb $(DIRLIB) /y
$(X_OBJS): $(OUTPUT_DIRS) $(LIBWEBP_OBJS) $(LIBWEBPMUX_OBJS): $(OUTPUT_DIRS)
!IF "$(DLLBUILD)" == "TRUE" !IF "$(DLLBUILD)" == "TRUE"
$(X_OBJS): $(DIROBJ)\$(DLLINC) $(DIROBJ)\$(DLLC) $(LIBWEBP_OBJS): $(DIROBJ)\$(DLLINC) $(DIROBJ)\$(DLLC)
{$(DIROBJ)}.c{$(DIROBJ)}.obj: {$(DIROBJ)}.c{$(DIROBJ)}.obj:
$(CC) $(CFLAGS) /Fd$(LIBPDBNAME) /Fo"$@" $< $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$@ $<
$(LIBWEBPMUX): $(LIBWEBP)
$(LIBWEBP) $(LIBWEBPMUX):
$(LNKDLL) /out:$(DIRBIN)\$(@B:_dll=.dll) /implib:$@ $(LFLAGS) $**
-xcopy $(DIROBJ)\*.pdb $(DIRLIB) /y
clean:: clean::
@-erase /s $(DIROBJ)\$(DLLC) $(DIROBJ)\$(DLLINC) 2> NUL @-erase /s $(DIROBJ)\$(DLLC) $(DIROBJ)\$(DLLINC) 2> NUL
!ELSE
$(LIBWEBP) $(LIBWEBPMUX):
$(LNKLIB) /out:$@ $(LFLAGS) $**
-xcopy $(DIROBJ)\*.pdb $(DIRLIB) /y
!ENDIF !ENDIF
$(EXAMPLES_OBJS): $(EX_UTIL_OBJS) $(DIRLIB)\$(TARGET)
$(OUTPUT_DIRS): $(OUTPUT_DIRS):
@if not exist "$(@)" mkdir "$(@)" @if not exist "$(@)" mkdir "$(@)"
@ -271,19 +266,19 @@ $(DIROBJ)\$(DLLC): $(DIROBJ)\$(DLLINC)
{examples}.c{$(DIROBJ)\examples}.obj:: {examples}.c{$(DIROBJ)\examples}.obj::
$(CC) $(CFLAGS) /Fd$(DIROBJ)\examples\ /Fo$(DIROBJ)\examples\ $< $(CC) $(CFLAGS) /Fd$(DIROBJ)\examples\ /Fo$(DIROBJ)\examples\ $<
{src\dec}.c{$(DIROBJ)\dec}.obj:: {src\dec}.c{$(DIROBJ)\dec}.obj::
$(CC) $(CFLAGS) /Fd$(LIBPDBNAME) /Fo$(DIROBJ)\dec\ $< $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\dec\ $<
{src\dsp}.c{$(DIROBJ)\dsp}.obj:: {src\dsp}.c{$(DIROBJ)\dsp}.obj::
$(CC) $(CFLAGS) /Fd$(LIBPDBNAME) /Fo$(DIROBJ)\dsp\ $< $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\dsp\ $<
{src\enc}.c{$(DIROBJ)\enc}.obj:: {src\enc}.c{$(DIROBJ)\enc}.obj::
$(CC) $(CFLAGS) /Fd$(LIBPDBNAME) /Fo$(DIROBJ)\enc\ $< $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\enc\ $<
{src\mux}.c{$(DIROBJ)\mux}.obj:: {src\mux}.c{$(DIROBJ)\mux}.obj::
$(CC) $(CFLAGS) /Fd$(LIBPDBNAME) /Fo$(DIROBJ)\mux\ $< $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\mux\ $<
{src\utils}.c{$(DIROBJ)\utils}.obj:: {src\utils}.c{$(DIROBJ)\utils}.obj::
$(CC) $(CFLAGS) /Fd$(LIBPDBNAME) /Fo$(DIROBJ)\utils\ $< $(CC) $(CFLAGS) /Fd$(LIBWEBP_PDBNAME) /Fo$(DIROBJ)\utils\ $<
{$(DIROBJ)\examples}.obj{$(DIRBIN)}.exe: {$(DIROBJ)\examples}.obj{$(DIRBIN)}.exe:
$(LNKEXE) $(LDFLAGS) /OUT:"$@" $< $(EX_UTIL_OBJS) \ $(LNKEXE) $(LDFLAGS) /OUT:$@ $** \
ole32.lib windowscodecs.lib shlwapi.lib $(DIRLIB)\$(TARGET) ole32.lib windowscodecs.lib shlwapi.lib
$(MT) -manifest $@.manifest -outputresource:$@;1 $(MT) -manifest $@.manifest -outputresource:$@;1
del $@.manifest del $@.manifest