File: Makefile.w32

package info (click to toggle)
pngcheck 2.3.0-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 352 kB
  • ctags: 210
  • sloc: ansic: 4,942; makefile: 31
file content (100 lines) | stat: -rw-r--r-- 2,924 bytes parent folder | download | duplicates (7)
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
# MSVC/NMAKE makefile for pngcheck.
# Greg Roelofs
# Last modified:  17 June 2006
#
# Invoke this makefile from a DOS prompt window via:
#
#	%devstudio%\vc\bin\vcvars32.bat
#	nmake -nologo -f Makefile.w32
#
# where %devstudio% is the installation directory for MSVC / DevStudio.  If
# you get "environment out of space" errors, create a desktop shortcut with
# "c:\windows\command.com /e:4096" as the program command line and set the
# working directory to this directory.  Then double-click to open the new
# DOS-prompt window with a bigger environment and retry the commands above.
# 
# This makefile assumes zlib has already been built or downloaded and is in
# a subdirectory at the same level as the current subdirectory (as indicated
# by the ZPATH macro below).  Edit as appropriate.
#
# Note that the names of the dynamic and static zlib libraries used below may
# change in later releases of the library.  This makefile builds statically
# linked executables, but that can be changed by uncommenting the appropriate
# ZLIB lines.

!include <ntwin32.mak>


# macros --------------------------------------------------------------------

ZPATH = ../zlib
ZINC = -I$(ZPATH)
#ZLIB = $(ZPATH)/zlibdll.lib
ZLIB = $(ZPATH)/zlibstat.lib

INCS = $(ZINC)
LIBS = $(ZLIB)

CC = cl
LD = link
RM = del
CFLAGS = -nologo -O -W3 $(INCS) -DUSE_ZLIB $(cvars)
# [note that -W3 is an MSVC-specific compilation flag ("all warnings on")]
# [see %devstudio%\vc\include\win32.mak for cvars macro definition]
O = .obj
E = .exe

LDFLAGS = -nologo

PROG  = pngcheck
PROG2 = pngsplit
PROG3 = png-fix-IDAT-windowsize

OBJS  = $(PROG)$(O)
OBJS2 = $(PROG2)$(O)
OBJS3 = $(PROG3)$(O)

EXES = $(PROG)$(E) $(PROG2)$(E) $(PROG3)$(E)


# implicit make rules -------------------------------------------------------

# GRR 20060617:  Can't remember if this dumps objects in current dir or in
#   same dir as source.  If latter, will need to modify PROG2/PROG3 targets
#   below (and/or OBJS* macros above) to include "gpl/" prefix on objects.
.c$(O):
	$(CC) -c $(CFLAGS) $<


# dependencies --------------------------------------------------------------

all:  $(EXES)

# setargv.obj expands wildcards and is included as part of MSVC; may be called
# "wildargs.obj" (or similar) for Borland or Watcom compilers
$(PROG)$(E): $(OBJS)
	$(LD) $(LDFLAGS) -out:$@ $(OBJS) setargv.obj $(LIBS)

$(PROG2)$(E): $(OBJS2)
	$(CC) $(CFLAGS) -out:$@ $(OBJS2) setargv.obj $(LIBS)

$(PROG3)$(E): $(OBJS3)
	$(CC) $(CFLAGS) -out:$@ $(OBJS3) setargv.obj $(LIBS)

$(PROG)$(O):	gpl/$(PROG).c
$(PROG2)$(O):	gpl/$(PROG2).c
$(PROG3)$(O):	gpl/$(PROG3).c


# maintenance ---------------------------------------------------------------

clean:
#	ideally we could just do this:
#	$(RM) $(EXES) $(OBJS) [etc.]
#	...but the Windows "DEL" command is none too bright, so:
	$(RM) $(PROG)$(E)
	$(RM) $(PROG)$(O)
	$(RM) $(PROG2)$(E)
	$(RM) $(PROG2)$(O)
	$(RM) $(PROG3)$(E)
	$(RM) $(PROG3)$(O)