• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# makefile for libpng
2# Copyright (C) 2020-2022 Cosmin Truta
3# Copyright (C) 2002, 2006, 2014 Glenn Randers-Pehrson
4# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
5#
6# This code is released under the libpng license.
7# For conditions of distribution and use, see the disclaimer
8# and license in png.h
9
10# Where the zlib library and include files are located
11#ZLIBLIB=/usr/local/lib
12#ZLIBINC=/usr/local/include
13ZLIBLIB=../zlib
14ZLIBINC=../zlib
15
16CC=gcc
17AR_RC=ar rc
18RANLIB=ranlib
19MKDIR_P=mkdir -p
20CP=cp
21RM_F=/bin/rm -f
22
23CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
24CFLAGS=-O
25LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
26
27# Pre-built configuration
28# See scripts/pnglibconf.mak for more options
29PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
30
31OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
32       pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
33       pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
34
35.c.o:
36	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
37
38all: libpng.a pngtest
39
40pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
41	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
42
43libpng.a: $(OBJS)
44	$(AR_RC) $@ $(OBJS)
45	$(RANLIB) $@
46
47pngtest: pngtest.o libpng.a
48	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
49
50test: pngtest
51	./pngtest
52
53install:
54	@echo "The $@ target is no longer supported by this makefile."
55	@false
56
57clean:
58	$(RM_F) *.o libpng.a pngtest pngout.png pnglibconf.h
59
60# DO NOT DELETE THIS LINE -- make depend depends on it.
61
62png.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
63pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
64pngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
65pngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
66pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
67pngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
68pngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
69pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
70pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
71pngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
72pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
73pngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
74pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
75pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
76pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
77
78pngtest.o:  png.h pngconf.h pnglibconf.h
79