xf.li | 6c8fc1e | 2023-08-12 00:11:09 -0700 | [diff] [blame^] | 1 | # makefile for libpng |
| 2 | # Copyright (C) 1998 Tim Wegner |
| 3 | # Copyright (C) 2006,2009,2011,2014 Glenn Randers-Pehrson |
| 4 | # |
| 5 | # This code is released under the libpng license. |
| 6 | # For conditions of distribution and use, see the disclaimer |
| 7 | # and license in png.h |
| 8 | # |
| 9 | # Assumes that zlib.lib, zconf.h, and zlib.h have been copied to ..\zlib |
| 10 | # To use, do "nmake /f scripts\makefile.vcwin32" |
| 11 | |
| 12 | # -------- Microsoft Visual C++ 2.0 and later -------- |
| 13 | |
| 14 | # Compiler, linker, librarian and other tools |
| 15 | CC = cl |
| 16 | LD = link |
| 17 | AR = lib |
| 18 | CPPFLAGS = -I..\zlib |
| 19 | CFLAGS = -nologo -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -MD -O2 -W3 |
| 20 | LDFLAGS = -nologo |
| 21 | ARFLAGS = -nologo |
| 22 | CP = copy |
| 23 | RM = del |
| 24 | |
| 25 | # Pre-built configuration |
| 26 | # See scripts\pnglibconf.mak for more options |
| 27 | PNGLIBCONF_H_PREBUILT = scripts\pnglibconf.h.prebuilt |
| 28 | |
| 29 | # File extensions |
| 30 | O=.obj |
| 31 | |
| 32 | #uncomment next to put error messages in a file |
| 33 | #ERRFILE= >> pngerrs.log |
| 34 | |
| 35 | # Variables |
| 36 | OBJS1 = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) |
| 37 | OBJS2 = pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) |
| 38 | OBJS3 = pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O) |
| 39 | OBJS = $(OBJS1) $(OBJS2) $(OBJS3) |
| 40 | |
| 41 | # Targets |
| 42 | all: libpng.lib |
| 43 | |
| 44 | pnglibconf.h: $(PNGLIBCONF_H_PREBUILT) |
| 45 | $(CP) $(PNGLIBCONF_H_PREBUILT) $@ |
| 46 | |
| 47 | png$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 48 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 49 | |
| 50 | pngset$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 51 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 52 | |
| 53 | pngget$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 54 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 55 | |
| 56 | pngread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 57 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 58 | |
| 59 | pngpread$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 60 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 61 | |
| 62 | pngrtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 63 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 64 | |
| 65 | pngrutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 66 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 67 | |
| 68 | pngerror$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 69 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 70 | |
| 71 | pngmem$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 72 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 73 | |
| 74 | pngrio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 75 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 76 | |
| 77 | pngwio$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 78 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 79 | |
| 80 | pngtrans$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 81 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 82 | |
| 83 | pngwrite$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 84 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 85 | |
| 86 | pngwtran$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 87 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 88 | |
| 89 | pngwutil$(O): png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h |
| 90 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 91 | |
| 92 | libpng.lib: $(OBJS) |
| 93 | -$(RM) $@ |
| 94 | $(AR) $(ARFLAGS) -out:$@ $(OBJS) $(ERRFILE) |
| 95 | |
| 96 | pngtest$(O): png.h pngconf.h pnglibconf.h |
| 97 | $(CC) -c $(CPPFLAGS) $(CFLAGS) $*.c $(ERRFILE) |
| 98 | |
| 99 | pngtest.exe: pngtest$(O) libpng.lib |
| 100 | $(LD) $(LDFLAGS) -out:$@ pngtest$(O) libpng.lib ..\zlib\zlib.lib $(ERRFILE) |
| 101 | |
| 102 | test: pngtest.exe |
| 103 | pngtest |
| 104 | |
| 105 | clean: |
| 106 | -$(RM) *$(O) |
| 107 | -$(RM) libpng.lib |
| 108 | -$(RM) pnglibconf.h |
| 109 | -$(RM) pngtest.exe |
| 110 | -$(RM) pngout.png |
| 111 | |
| 112 | # End of makefile for libpng |
| 113 | |