blob: 418726159d30deb2581f8b944e4acdc3098ccb7f [file] [log] [blame]
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -05001# Makefile for libpng
2# Microsoft Visual C++ with Intel C/C++ Compiler 4.0 and later
3
Glenn Randers-Pehrson5af03072014-01-20 12:36:30 -06004# Copyright (C) 2006, 2014 Glenn Randers-Pehrson
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -05005# Copyright (C) 2000, Pawel Mrochen, based on makefile.msc which is
6# copyright 1995 Guy Eric Schalnat, Group 42, Inc.
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -05007#
Glenn Randers-Pehrsonbfbf8652009-06-26 21:46:52 -05008# This code is released under the libpng license.
Glenn Randers-Pehrsonc332bbc2009-06-25 13:43:50 -05009# For conditions of distribution and use, see the disclaimer
Glenn Randers-Pehrson037023b2009-06-24 10:27:36 -050010# and license in png.h
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -050011#
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050012# To use, do "nmake /f scripts\makefile.intel"
Glenn Randers-Pehrson3e61d792009-06-24 09:31:28 -050013#
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050014# ------------------- Intel C/C++ Compiler 4.0 and later -------------------
15
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050016# Where the zlib library and include files are located
17ZLIBLIB=..\zlib
18ZLIBINC=..\zlib
19
20# Target CPU
21CPU=6 # Pentium II
22#CPU=5 # Pentium
23
24# Calling convention
25CALLING=r # __fastcall
26#CALLING=z # __stdcall
27#CALLING=d # __cdecl
28
29# Uncomment next to put error messages in a file
30#ERRFILE=>>pngerrs
31
32# --------------------------------------------------------------------------
33
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050034CC=icl -c
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060035CPPFLAGS=-I$(ZLIBINC)
36CFLAGS=-O2 -G$(CPU)$(CALLING) -Qip -Qunroll4 -nologo
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050037LD=link
38LDFLAGS=/SUBSYSTEM:CONSOLE /NOLOGO
Cosmin Truta82200da2014-03-22 09:29:59 -050039CP=cp
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050040
Cosmin Truta9ab7b4c2014-03-22 13:13:11 -050041# Pre-built configuration
Glenn Randers-Pehrsonae991772014-07-21 11:52:27 -050042# See scripts\pnglibconf.mak for more options
Glenn Randers-Pehrson071a17f2014-07-21 11:27:26 -050043PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt
Cosmin Truta9ab7b4c2014-03-22 13:13:11 -050044
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050045O=.obj
46
Glenn Randers-Pehrsond56aca72000-11-23 11:51:42 -060047OBJS=png$(O) pngset$(O) pngget$(O) pngrutil$(O) pngtrans$(O) pngwutil$(O) \
48pngmem$(O) pngpread$(O) pngread$(O) pngerror$(O) pngwrite$(O) \
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050049pngrtran$(O) pngwtran$(O) pngrio$(O) pngwio$(O)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050050
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -050051all: test
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050052
Cosmin Truta9ab7b4c2014-03-22 13:13:11 -050053pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
Glenn Randers-Pehrsonff649a02014-08-07 19:51:35 -050054 $(CP) $(PNGLIBCONF_H_PREBUILT) $@
Glenn Randers-Pehrson72531442010-04-17 08:17:51 -050055
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060056png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
57 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050058
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060059pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
60 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050061
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060062pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
63 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050064
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060065pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
66 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050067
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060068pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
69 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050070
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060071pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
72 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050073
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060074pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
75 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050076
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060077pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
78 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050079
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060080pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
81 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050082
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060083pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
84 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050085
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060086pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
87 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050088
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060089pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
90 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050091
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060092pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
93 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050094
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060095pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
96 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -050097
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -060098pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
99 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500100
101libpng.lib: $(OBJS)
102 if exist libpng.lib del libpng.lib
103 lib /NOLOGO /OUT:libpng.lib $(OBJS)
104
105pngtest.exe: pngtest.obj libpng.lib
106 $(LD) $(LDFLAGS) /OUT:pngtest.exe pngtest.obj libpng.lib $(ZLIBLIB)\zlib.lib
107
Glenn Randers-Pehrson0b3634b2011-12-17 09:57:00 -0600108pngtest$(O): png.h pngconf.h pnglibconf.h
Glenn Randers-Pehrson42503282014-01-12 10:44:01 -0600109 $(CC) $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE)
Glenn Randers-Pehrson glennrp@comcast.net7ecf7bd2009-05-02 15:36:08 -0500110
Glenn Randers-Pehrson6942d532000-05-01 09:31:54 -0500111test: pngtest.exe
112 pngtest.exe
113
114
115# End of makefile for libpng