summaryrefslogtreecommitdiffstats
path: root/tkimg/win/rules-img.vc
blob: 93093d57321d37b8006ab2fe01e64d532e700ee1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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