makefile.aix 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # makefile for libpng using gcc (generic, static library)
  2. # Copyright (C) 2002, 2006 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. # For conditions of distribution and use, see copyright notice in png.h
  7. # Location of the zlib library and include files
  8. ZLIBINC = ../zlib
  9. ZLIBLIB = ../zlib
  10. # Compiler, linker, lib and other tools
  11. CC = gcc
  12. LD = $(CC)
  13. AR_RC = ar rcs
  14. MKDIR_P = mkdir -p
  15. RANLIB = ranlib
  16. RM_F = rm -f
  17. LN_SF = ln -f -s
  18. LIBNAME=libpng12
  19. PNGMAJ = 0
  20. PNGMIN = 1.2.24
  21. PNGVER = $(PNGMAJ).$(PNGMIN)
  22. prefix=/usr/local
  23. INCPATH=$(prefix)/include
  24. LIBPATH=$(prefix)/lib
  25. # override DESTDIR= on the make install command line to easily support
  26. # installing into a temporary location. Example:
  27. #
  28. # make install DESTDIR=/tmp/build/libpng
  29. #
  30. # If you're going to install into a temporary location
  31. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  32. # you execute make install.
  33. DESTDIR=
  34. DI=$(DESTDIR)$(INCPATH)
  35. DL=$(DESTDIR)$(LIBPATH)
  36. CDEBUG = -g -DPNG_DEBUG=5
  37. LDDEBUG =
  38. CRELEASE = -O2
  39. LDRELEASE = -s
  40. WARNMORE=-Wall
  41. CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
  42. LDFLAGS = -L. -L$(ZLIBLIB) -lpng12 -lz -lm $(LDRELEASE)
  43. # File extensions
  44. O=.o
  45. A=.a
  46. E=
  47. # Variables
  48. OBJS = png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
  49. pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
  50. pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
  51. # Targets
  52. all: $(LIBNAME)$(A) pngtest$(E)
  53. $(LIBNAME)$(A): $(OBJS)
  54. $(AR_RC) $@ $(OBJS)
  55. $(RANLIB) $@
  56. test: pngtest$(E)
  57. ./pngtest$(E)
  58. pngtest$(E): pngtest$(O) $(LIBNAME)$(A)
  59. $(LD) -o $@ pngtest$(O) $(LDFLAGS)
  60. install: $(LIBNAME)$(A)
  61. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  62. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  63. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  64. -@$(RM_F) $(DI)/$(LIBNAME)/png.h
  65. -@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h
  66. -@$(RM_F) $(DI)/png.h
  67. -@$(RM_F) $(DI)/pngconf.h
  68. cp png.h pngconf.h $(DI)/$(LIBNAME)
  69. chmod 644 $(DI)/$(LIBNAME)/png.h \
  70. $(DI)/$(LIBNAME)/pngconf.h
  71. -@$(RM_F) -r $(DI)/libpng
  72. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  73. -@$(RM_F) $(DL)/$(LIBNAME)$(A)
  74. -@$(RM_F) $(DL)/libpng$(A)
  75. cp $(LIBNAME)$(A) $(DL)/$(LIBNAME)$(A)
  76. chmod 644 $(DL)/$(LIBNAME)$(A)
  77. (cd $(DL); $(LN_SF) $(LIBNAME)$(A) libpng$(A))
  78. (cd $(DI); $(LN_SF) libpng/* .;)
  79. clean:
  80. $(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png
  81. png$(O): png.h pngconf.h
  82. pngerror$(O): png.h pngconf.h
  83. pngget$(O): png.h pngconf.h
  84. pngmem$(O): png.h pngconf.h
  85. pngpread$(O): png.h pngconf.h
  86. pngread$(O): png.h pngconf.h
  87. pngrio$(O): png.h pngconf.h
  88. pngrtran$(O): png.h pngconf.h
  89. pngrutil$(O): png.h pngconf.h
  90. pngset$(O): png.h pngconf.h
  91. pngtest$(O): png.h pngconf.h
  92. pngtrans$(O): png.h pngconf.h
  93. pngwio$(O): png.h pngconf.h
  94. pngwrite$(O): png.h pngconf.h
  95. pngwtran$(O): png.h pngconf.h
  96. pngwutil$(O): png.h pngconf.h