blob: b17f6a46fae6131f8e656ca96f49c98e028f06d7 [file] [log] [blame]
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -05001# makefile for libpng
2# Copyright (C) 1998 Tim Wegner
Glenn Randers-Pehrson5af03072014-01-20 12:36:30 -06003# Copyright (C) 2006,2009,2011,2014 Glenn Randers-Pehrson
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -05004#
Glenn Randers-Pehrsonbfbf8652009-06-26 21:46:52 -05005# This code is released under the libpng license.
Glenn Randers-Pehrsonc332bbc2009-06-25 13:43:50 -05006# For conditions of distribution and use, see the disclaimer
Glenn Randers-Pehrson037023b2009-06-24 10:27:36 -05007# and license in png.h
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -05008#
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -05009# Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib
Glenn Randers-Pehrsonbcfd15d1999-10-01 14:22:25 -050010# To use, do "nmake /f scripts\makefile.vcwin32"
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050011
Cosmin Truta82200da2014-03-22 09:29:59 -050012# -------- Microsoft Visual C++ 2.0 and later --------
Glenn Randers-Pehrsonbcfd15d1999-10-01 14:22:25 -050013
Cosmin Truta82200da2014-03-22 09:29:59 -050014# Compiler, linker, librarian and other tools
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050015CC = cl
16LD = link
17AR = lib
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060018CPPFLAGS = -I..\zlib
19CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -MD -O2 -W3
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050020LDFLAGS = -nologo
21ARFLAGS = -nologo
Cosmin Truta82200da2014-03-22 09:29:59 -050022CP = copy
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050023RM = del
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050024
Cosmin Truta9ab7b4c2014-03-22 13:13:11 -050025# Pre-built configuration
26# See scripts/pnglibconf.mak for more options
27PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
28
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050029# File extensions
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050030O=.obj
31
32#uncomment next to put error messages in a file
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050033#ERRFILE= >> pngerrs.log
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050034
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050035# Variables
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050036OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O)
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050037OBJS2 = pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O)
38OBJS3 = pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
39OBJS = $(OBJS1) $(OBJS2) $(OBJS3)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050040
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050041# Targets
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050042all: libpng.lib
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050043
Cosmin Truta9ab7b4c2014-03-22 13:13:11 -050044pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
Cosmin Truta82200da2014-03-22 09:29:59 -050045 $(CP) $< $@
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050046
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060047png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
48 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050049
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060050pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
51 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050052
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060053pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
54 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrsonb3870ab2006-05-11 09:43:09 -050055
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060056pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
57 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050058
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060059pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
60 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050061
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060062pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
63 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050064
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060065pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
66 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050067
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060068pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
69 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson4393a9a1999-09-17 12:27:26 -050070
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060071pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
72 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050073
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060074pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
75 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050076
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060077pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050079
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060080pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
81 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050082
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060083pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
84 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050085
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060086pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
87 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050088
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060089pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
90 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050091
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050092libpng.lib: $(OBJS)
93 -$(RM) $@
94 $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -050095
Glenn Randers-Pehrson0b3634b2011-12-17 09:57:00 -060096pngtest$(O): png.h pngconf.h pnglibconf.h
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060097 $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050098
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -050099pngtest.exe: pngtest$(O) libpng.lib
100 $(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE)
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -0500101
102test: pngtest.exe
103 pngtest
104
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -0500105clean:
106 -$(RM) *$(O)
107 -$(RM) libpng.lib
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -0500108 -$(RM) pnglibconf.h
Glenn Randers-Pehrson5b5dcf82004-07-17 22:45:44 -0500109 -$(RM) pngtest.exe
110 -$(RM) pngout.png
111
Glenn Randers-Pehrson345bc271998-06-14 14:43:31 -0500112# End of makefile for libpng
113