• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# makefile for libpng
2# Copyright (C) 2002, 2014 Glenn Randers-Pehrson
3# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
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# Modified for LC56/ATARI assumes libz.lib is in same dir and uses default
10# rules for library management
11#
12CPPFLAGS = -I..\zlib
13CFLAGS = -O
14LBR = png.lib
15LDFLAGS = -L. -L..\zlib -lpng -lz -lm
16
17# where make install puts libpng.a and png.h
18prefix=/usr/local
19INCPATH=$(prefix)/include
20LIBPATH=$(prefix)/lib
21
22# override DESTDIR= on the make install command line to easily support
23# installing into a temporary location.  Example:
24#
25#    make install DESTDIR=/tmp/build/libpng
26#
27# If you're going to install into a temporary location
28# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
29# you execute make install.
30DESTDIR=
31
32OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
33	$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
34	$(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\
35	$(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\
36	$(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o)
37
38all: $(LBR) pngtest.ttp
39
40.c.o:
41	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
42
43$(LBR): $(OBJS)
44
45$(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h
46
47pnglibconf.h: scripts/pnglibconf.h.prebuilt
48	cp scripts/pnglibconf.h.prebuilt pnglibconf.h
49
50pngtest.ttp: pngtest.o $(LBR)
51	$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
52
53install: libpng.a
54	-@mkdir $(DESTDIR)$(INCPATH)
55	-@mkdir $(DESTDIR)$(INCPATH)/libpng
56	-@mkdir $(DESTDIR)$(LIBPATH)
57	-@rm -f $(DESTDIR)$(INCPATH)/png.h
58	-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
59	-@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
60	cp png.h $(DESTDIR)$(INCPATH)/libpng
61	cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
62	cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
63	chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
64	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
65	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
66	(cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
67	ln -f -s $(LIBNAME)/* .)
68