Home | History | Annotate | Download | only in scripts
      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 #
     12 CPPFLAGS = -I..\zlib
     13 CFLAGS = -O
     14 LBR = png.lib
     15 LDFLAGS = -L. -L..\zlib -lpng -lz -lm
     16 
     17 # where make install puts libpng.a and png.h
     18 prefix=/usr/local
     19 INCPATH=$(prefix)/include
     20 LIBPATH=$(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.
     30 DESTDIR=
     31 
     32 # Pre-built configuration
     33 # See scripts/pnglibconf.mak for more options
     34 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
     35 
     36 OBJS = $(LBR)(png.o) $(LBR)(pngset.o) $(LBR)(pngget.o) $(LBR)(pngrutil.o)\
     37 	$(LBR)(pngtrans.o) $(LBR)(pngwutil.o)\
     38 	$(LBR)(pngread.o) $(LBR)(pngerror.o) $(LBR)(pngwrite.o)\
     39 	$(LBR)(pngrtran.o) $(LBR)(pngwtran.o)\
     40 	$(LBR)(pngmem.o) $(LBR)(pngrio.o) $(LBR)(pngwio.o) $(LBR)(pngpread.o)
     41 
     42 all: $(LBR) pngtest.ttp
     43 
     44 .c.o:
     45 	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<
     46 
     47 $(LBR): $(OBJS)
     48 
     49 $(OBJS): pngpriv.h png.h pngconf.h pnglibconf.h pnginfo.h pngstruct.h pngdebug.h
     50 
     51 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
     52 	cp $(PNGLIBCONF_H_PREBUILT) $@
     53 
     54 pngtest.ttp: pngtest.o $(LBR)
     55 	$(CC) $(CFLAGS) $(LDFLAGS) -o$@ pngtest.o
     56 
     57 install: libpng.a
     58 	-@mkdir $(DESTDIR)$(INCPATH)
     59 	-@mkdir $(DESTDIR)$(INCPATH)/libpng
     60 	-@mkdir $(DESTDIR)$(LIBPATH)
     61 	-@rm -f $(DESTDIR)$(INCPATH)/png.h
     62 	-@rm -f $(DESTDIR)$(INCPATH)/pngconf.h
     63 	-@rm -f $(DESTDIR)$(INCPATH)/pnglibconf.h
     64 	cp png.h $(DESTDIR)$(INCPATH)/libpng
     65 	cp pngconf.h $(DESTDIR)$(INCPATH)/libpng
     66 	cp pnglibconf.h $(DESTDIR)$(INCPATH)/libpng
     67 	chmod 644 $(DESTDIR)$(INCPATH)/libpng/png.h
     68 	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pngconf.h
     69 	chmod 644 $(DESTDIR)$(INCPATH)/libpng/pnglibconf.h
     70 	(cd $(DESTDIR)$(INCPATH); ln -f -s $(LIBNAME) libpng; \
     71 	ln -f -s $(LIBNAME)/* .)
     72