diff options
Diffstat (limited to 'tkimg/win/rules-img.vc')
-rwxr-xr-x | tkimg/win/rules-img.vc | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/tkimg/win/rules-img.vc b/tkimg/win/rules-img.vc new file mode 100755 index 0000000..93093d5 --- /dev/null +++ b/tkimg/win/rules-img.vc @@ -0,0 +1,116 @@ +# This is a common include file used by Img modules. +# PHIMGTPE should be defined before inclusion as the image type, e.g. png + +!ifndef PHIMGTYPE +!error PHIMGTYPE not defined! +!endif + +!if "$(PROJECT)" == "" +PROJECT = tkimg$(PHIMGTYPE) +!endif + +!ifndef PACKAGE_TCLNAME +PRJ_PACKAGE_TCLNAME = img::$(PHIMGTYPE) +!endif + +!ifndef CPACKAGE +CPACKAGE = Tkimg$(PHIMGTYPE) +!endif + +NEED_TK_SOURCE = 1 +NEED_TCL_SOURCE = 1 + +!ifndef PRJ_OBJS +PRJ_OBJS = $(TMP_DIR)\$(PHIMGTYPE).obj +!endif + +!include "..\..\win\rules-ext.vc" + +!if [echo TKIMG_VERSION = \> versions.vc] \ + || [nmakehlp -V ..\..\base\configure.in ^[tkimg^] >> versions.vc] +!error Could not determine tkimg base version. +!endif +!include versions.vc + +PRJ_INCLUDES = $(PRJ_INCLUDES) -I"$(TMP_DIR)" -I"..\..\base" +PRJ_DEFINES = $(PRJ_DEFINES) -DPACKAGE_TCLNAME="\"$(PACKAGE_TCLNAME)\"" -DTKIMG_VERSION="\"$(TKIMG_VERSION)"\" +PRJ_LIBS = $(PRJ_LIBS) "..\..\base\win\$(BUILDDIRTOP)\tkimgstub$(TKIMG_VERSION:.=).lib" + +!ifdef REQUIRE_LIBJPEG +!if [echo LIBJPEG_VERSION = \> versions.vc] \ + || [nmakehlp -V ..\..\libjpeg\configure.in ^[jpegtcl^] >> versions.vc] +!error Could not determine libjpeg base version. +!endif +!include versions.vc +PRJ_INCLUDES = $(PRJ_INCLUDES) -I"$(TMP_DIR)" -I../../libjpeg +PRJ_LIBS = $(PRJ_LIBS) "..\..\libjpeg\win\$(BUILDDIRTOP)\jpegtclstub$(LIBJPEG_VERSION:.=).lib" +!endif + +!ifdef REQUIRE_ZLIB +!if [echo ZLIB_VERSION = \> versions.vc] \ + || [nmakehlp -V ..\..\zlib\configure.in ^[zlibtcl^] >> versions.vc] +!error Could not determine zlib base version. +!endif +!include versions.vc +PRJ_INCLUDES = $(PRJ_INCLUDES) -I"$(TMP_DIR)" -I../../zlib +PRJ_LIBS = $(PRJ_LIBS) "..\..\zlib\win\$(BUILDDIRTOP)\zlibtclstub$(ZLIB_VERSION:.=).lib" +!endif + +!ifdef REQUIRE_LIBPNG +!if [echo LIBPNG_VERSION = \> versions.vc] \ + || [nmakehlp -V ..\..\libpng\configure.in ^[pngtcl^] >> versions.vc] +!error Could not determine libpng base version. +!endif +!include versions.vc +PRJ_INCLUDES = $(PRJ_INCLUDES) -I"$(TMP_DIR)" -I../../libpng +PRJ_LIBS = $(PRJ_LIBS) "..\..\libpng\win\$(BUILDDIRTOP)\pngtclstub$(LIBPNG_VERSION:.=).lib" +!endif + +!ifdef REQUIRE_LIBTIFF +!if [echo LIBTIFF_VERSION = \> versions.vc] \ + || [nmakehlp -V ..\..\libtiff\configure.in ^[tifftcl^] >> versions.vc] +!error Could not determine libtiff base version. +!endif +!include versions.vc +PRJ_INCLUDES = $(PRJ_INCLUDES) -I"$(TMP_DIR)" -I../../libtiff -I../../libtiff/libtiff +PRJ_LIBS = $(PRJ_LIBS) "..\..\libtiff\win\$(BUILDDIRTOP)\tifftclstub$(LIBTIFF_VERSION:.=).lib" +!endif + +# We have our own install target as we want installation to go into +# a common directory. +DISABLE_TARGET_install = 1 +!include "$(_RULESDIR)\targets.vc" + +pkgindex: default-pkgindex + +$(PRJ_OBJS): $(TMP_DIR)\init.c +$(TMP_DIR)\init.c: + nmakehlp -s << ..\..\init.c > $(TMP_DIR)\init.c +@CPACKAGE@ $(CPACKAGE) +%PACKAGE% $(PACKAGE_NAME) +%PHIMGTYPE% $(PHIMGTYPE) +<< + +# Special install targets to install all DLL's into the main img directory +# When a component is build by itself, e.g. png, it will install into the +# directory named after the component. When installed through the "master" +# Img makefile, it installs in the Img directory. The following takes +# care of the details. +!ifdef TKIMG_INSTALL_SUBDIR +IMG_INSTALL_DIR = $(_INSTALLDIR)\$(TKIMG_INSTALL_SUBDIR) +!else +IMG_INSTALL_DIR = $(SCRIPT_INSTALL_DIR) +!endif +install: $(OUT_DIR)\pkgIndex.tcl + @echo Installing binaries to '$(IMG_INSTALL_DIR)' + @if not exist "$(IMG_INSTALL_DIR)" mkdir "$(IMG_INSTALL_DIR)" + @$(CPY) $(PRJLIB) "$(IMG_INSTALL_DIR)" >NUL + @echo Installing libraries to '$(IMG_INSTALL_DIR)' + @if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(IMG_INSTALL_DIR)" +!ifdef TKIMG_INSTALL_SUBDIR + @echo Adding package index to '$(IMG_INSTALL_DIR)\pkgIndex.tcl' + @type $(OUT_DIR)\pkgIndex.tcl >> "$(IMG_INSTALL_DIR)\pkgIndex.tcl" +!else + @echo Installing package index in '$(IMG_INSTALL_DIR)' + @$(CPY) $(OUT_DIR)\pkgIndex.tcl $(IMG_INSTALL_DIR) +!endif |