summaryrefslogtreecommitdiffstats
path: root/tkimg/win/makefile.vc
blob: b5a9bd9aa7c5ec6f4e0d700e33510474bcba45be (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
# This is the master makefile to build all tkimg components. Run as
# 
#   nmake /s /nologo /f makefile.vc INSTALLDIR=c:\full\path\to\installdir TCLDIR=c:\full\path\to\tcl\sources TKDIR=c:\full\path\to\tk\sources
#
# To build specific modules, pass the MODULES macro on the command line
#
#   nmake /s /nologo /f makefile.vc INSTALLDIR=path\to\installdir TCLDIR=path\to\tcl\sources TKDIR=path\to\tk\sources MODULES="png jpeg"
#
# You may specify following additional targets: install, clean, hose, realclean. For example, to install
#
#   nmake /s /nologo /f makefile.vc INSTALLDIR=path\to\installdir TCLDIR=path\to\tcl\sources TKDIR=path\to\tk\sources install

!if !exist("makefile.vc")
!error You must run nmake from the directory containing this makefile.
!endif

!if "$(TCLDIR)" == "" || "$(TKDIR)" == ""
!error You must define TCLDIR and TKDIR on the command line as paths to the Tcl and Tk source trees.
!endif

# If relative paths are passed in, we need to convert them to absolute paths.
# Since nmake is so lame, we need to use nmakehlp for the purpose
!if [$(CC) -nologo "nmakehlp.c" -link -subsystem:console > nul]
!error Failed to compiler nmakehlp.
!endif
!if [echo TCLDIR = \> nmakehlp.out] \
   || [nmakehlp -Q "$(TCLDIR)" >> nmakehlp.out]
!error *** Could not fully qualify path TCLDIR="$(TCLDIR)"
!endif

!if [echo TKDIR = \>> nmakehlp.out] \
   || [nmakehlp -Q "$(TKDIR)" >> nmakehlp.out]
!error *** Could not fully qualify path TKDIR="$(TKDIR)"
!endif

!if [echo INSTALLDIR = \>> nmakehlp.out] \
   || [nmakehlp -Q "$(INSTALLDIR)" >> nmakehlp.out]
!error *** Could not fully qualify path INSTALLDIR="$(INSTALLDIR)"
!endif

# We need to undef TCLDIR and TKDIR since macros passed on command line
# do not get overridden from within makefile definitions
!undef INSTALLDIR
!undef TCLDIR
!undef TKDIR
!include nmakehlp.out

# Find out the main TKIMG_VERSION as we need it for the install directory
!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
TKIMG_INSTALL_SUBDIR = Img$(TKIMG_VERSION)

ALLMODULES = bmp dted gif ico jpeg libjpeg libpng libtiff pcx pixmap png ppm \
	  ps raw sgi sun tga tiff window xbm xpm zlib
!if "$(MODULES)" == ""
MODULES = $(ALLMODULES)
!endif

all: $(MODULES)

base $(ALLMODULES): .PHONY
	echo Making $@
	cd ..\$@\win && $(MAKE) /$(MAKEFLAGS) /f makefile.vc $(TARGET) OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) INSTALLDIR=$(INSTALLDIR) TCLDIR=$(TCLDIR) TKDIR=$(TKDIR)

$(ALLMODULES): base
png: zlib libpng
jpeg: libjpeg
tiff: zlib libjpeg libtiff
libpng: zlib

install:
	$(MAKE) /$(MAKEFLAGS) /f makefile.vc TARGET=install OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) INSTALLDIR=$(INSTALLDIR) TCLDIR=$(TCLDIR) TKDIR=$(TKDIR) TKIMG_INSTALL_SUBDIR=$(TKIMG_INSTALL_SUBDIR)

clean hose realclean: .PHONY
	$(MAKE) /$(MAKEFLAGS) /f makefile.vc TARGET=$@ OPTS=$(OPTS) STATS=$(STATS) CHECKS=$(CHECKS) INSTALLDIR=$(INSTALLDIR) TCLDIR=$(TCLDIR) TKDIR=$(TKDIR)
	@del nmakehlp.out version*.vc nmakehlp.obj nmakehlp.exe 

.PHONY: