-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile.mingw32
71 lines (52 loc) · 1.85 KB
/
Makefile.mingw32
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
# Sample makefile for pngcheck using mingw32-gcc (native or cross) and make.
# Greg Roelofs
# Last modified: 12 July 2007
#
# Invoke this makefile from a DOS-prompt window via:
#
# make -f Makefile.mingw32
#
# 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 line.
# macros --------------------------------------------------------------------
#ZPATH = ../zlib
ZPATH = ../zlib-win32
ZINC = -I$(ZPATH)
#ZLIB = $(ZPATH)/libzdll.a # link dynamically against DLL
ZLIB = $(ZPATH)/libz.a # link statically
INCS = $(ZINC)
LIBS = $(ZLIB)
#CC = gcc
CC = i386-mingw32msvc-gcc # e.g., Linux -> Win32 cross-compilation
LD = $(CC)
RM = rm -f
CFLAGS = -O -Wall $(INCS) $(MINGW_CCFLAGS) -DUSE_ZLIB
# [note that -Wall is a gcc-specific compilation flag ("most warnings on")]
LDFLAGS = $(MINGW_LDFLAGS)
O = .o
E = .exe
PROG = pngcheck
PROG2 = pngsplit
PROG3 = png-fix-IDAT-windowsize
EXES = $(PROG)$(E) $(PROG2)$(E) $(PROG3)$(E)
# implicit make rules -------------------------------------------------------
.c$(O):
$(CC) -c $(CFLAGS) $<
# dependencies --------------------------------------------------------------
all: $(EXES)
$(PROG)$(E): $(PROG).c
$(CC) $(CFLAGS) -o $@ $(PROG).c $(LIBS)
# both of these require zlib, too (for crc32() function)
$(PROG2)$(E): gpl/$(PROG2).c
$(CC) $(CFLAGS) -o $@ gpl/$(PROG2).c $(LIBS)
$(PROG3)$(E): gpl/$(PROG3).c
$(CC) $(CFLAGS) -o $@ gpl/$(PROG3).c $(LIBS)
# maintenance ---------------------------------------------------------------
clean:
$(RM) $(EXES)