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
|
# Sample makefile for pngcheck using mingw32-gcc (native or cross) and make.
# This one is currently set up for Win64 cross-compilation from Linux.
#
# Greg Roelofs
# Last modified: 31 January 2021
#
# Invoke this makefile from a DOS-prompt window or xterm or whatever via:
#
# make -f Makefile.mingw64
#
# 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-1.2.11-win64
ZINC = -I$(ZPATH)
#ZLIB = $(ZPATH)/libzdll.a # link dynamically against DLL
ZLIB = $(ZPATH)/libz.a # link statically
INCS = $(ZINC)
LIBS = $(ZLIB)
#CC = gcc
CC = x86_64-w64-mingw32-gcc # Linux -> Win64 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 = .win64.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)
|