makefile.aix 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. # makefile for libpng using gcc (generic, static library)
  2. # Copyright (C) 2002, 2006-2009, 2014 Glenn Randers-Pehrson
  3. # Copyright (C) 2000 Cosmin Truta
  4. # Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
  5. # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
  6. #
  7. # This code is released under the libpng license.
  8. # For conditions of distribution and use, see the disclaimer
  9. # and license in png.h
  10. # Location of the zlib library and include files
  11. ZLIBINC = ../zlib
  12. ZLIBLIB = ../zlib
  13. # Compiler, linker, lib and other tools
  14. CC = gcc
  15. LD = $(CC)
  16. AR_RC = ar rcs
  17. MKDIR_P = mkdir -p
  18. RANLIB = ranlib
  19. RM_F = rm -f
  20. LN_SF = ln -f -s
  21. LIBNAME = libpng16
  22. PNGMAJ = 16
  23. prefix=/usr/local
  24. INCPATH=$(prefix)/include
  25. LIBPATH=$(prefix)/lib
  26. # override DESTDIR= on the make install command line to easily support
  27. # installing into a temporary location. Example:
  28. #
  29. # make install DESTDIR=/tmp/build/libpng
  30. #
  31. # If you're going to install into a temporary location
  32. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  33. # you execute make install.
  34. DESTDIR=
  35. DI=$(DESTDIR)$(INCPATH)
  36. DL=$(DESTDIR)$(LIBPATH)
  37. WARNMORE =
  38. CPPFLAGS = -I$(ZLIBINC) # -DPNG_DEBUG=5
  39. CFLAGS = -W -Wall -O2 # $(WARNMORE) -g
  40. LDFLAGS = -L. -L$(ZLIBLIB) -lpng16 -lz -lm
  41. # Variables
  42. OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
  43. pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
  44. pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
  45. # Targets
  46. .c.o:
  47. $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
  48. all: $(LIBNAME).a pngtest$(E)
  49. include scripts/pnglibconf.mak
  50. REMOVE = $(RM_F)
  51. DFNFLAGS = $(DEFS) $(CPPFLAGS)
  52. $(LIBNAME).a: $(OBJS)
  53. $(AR_RC) $@ $(OBJS)
  54. $(RANLIB) $@
  55. test: pngtest$(E)
  56. ./pngtest$(E)
  57. pngtest$(E): pngtest.o $(LIBNAME).a
  58. $(LD) -o $@ pngtest.o $(LDFLAGS)
  59. install: $(LIBNAME).a
  60. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  61. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  62. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  63. -@$(RM_F) $(DI)/$(LIBNAME)/png.h
  64. -@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h
  65. -@$(RM_F) $(DI)/$(LIBNAME)/pnglibconf.h
  66. -@$(RM_F) $(DI)/png.h
  67. -@$(RM_F) $(DI)/pngconf.h
  68. -@$(RM_F) $(DI)/pnglibconf.h
  69. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  70. chmod 644 $(DI)/$(LIBNAME)/png.h \
  71. $(DI)/$(LIBNAME)/pngconf.h \
  72. $(DI)/$(LIBNAME)/pnglibconf.h
  73. -@$(RM_F) -r $(DI)/libpng
  74. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  75. -@$(RM_F) $(DL)/$(LIBNAME).a
  76. -@$(RM_F) $(DL)/libpng.a
  77. cp $(LIBNAME).a $(DL)/$(LIBNAME).a
  78. chmod 644 $(DL)/$(LIBNAME).a
  79. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  80. (cd $(DI); $(LN_SF) libpng/* .;)
  81. clean:
  82. $(RM_F) *.o $(LIBNAME).a pngtest pngout.png pnglibconf.h
  83. png.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  84. pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  85. pngget.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  86. pngmem.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  87. pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  88. pngread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  89. pngrio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  90. pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  91. pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  92. pngset.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  93. pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  94. pngwio.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  95. pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  96. pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  97. pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  98. pngtest.o: png.h pngconf.h pnglibconf.h