makefile.beos 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. # makefile for libpng on BeOS x86 ELF with gcc
  2. # modified from makefile.linux by Sander Stoks
  3. # Copyright (C) 2002, 2006, 2008, 2010-2011 Glenn Randers-Pehrson
  4. # Copyright (C) 1999 Greg Roelofs
  5. # Copyright (C) 1996, 1997 Andreas Dilger
  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. # Library name:
  11. LIBNAME=libpng15
  12. PNGMAJ = 15
  13. # Shared library names:
  14. LIBSO=$(LIBNAME).so
  15. LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
  16. LIBSOREL=$(LIBSOMAJ).$(RELEASE)
  17. OLDSO=libpng.so
  18. # Utilities:
  19. CC=gcc
  20. AR_RC=ar rc
  21. MKDIR_P=mkdir -p
  22. LN_SF=ln -sf
  23. RANLIB=ranlib
  24. RM_F=/bin/rm -f
  25. # Where the zlib library and include files are located
  26. ZLIBLIB=/usr/local/lib
  27. ZLIBINC=/usr/local/include
  28. ALIGN=
  29. # For i386:
  30. # ALIGN=-malign-loops=2 -malign-functions=2
  31. WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
  32. -Wmissing-declarations -Wtraditional -Wcast-align \
  33. -Wstrict-prototypes -Wmissing-prototypes #-Wconversion
  34. # On BeOS, -O1 is actually better than -O3. This is a known bug but it's
  35. # still here in R4.5
  36. CFLAGS=-I$(ZLIBINC) -W -Wall -O1 -funroll-loops \
  37. $(ALIGN) # $(WARNMORE) -g -DPNG_DEBUG=5
  38. # LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
  39. LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz
  40. # where make install puts libpng.a, libpng15.so*, and png.h
  41. prefix=/usr/local
  42. exec_prefix=$(prefix)
  43. INCPATH=$(prefix)/include
  44. LIBPATH=$(exec_prefix)/lib
  45. MANPATH=$(prefix)/man
  46. BINPATH=$(exec_prefix)/bin
  47. # override DESTDIR= on the make install command line to easily support
  48. # installing into a temporary location. Example:
  49. #
  50. # make install DESTDIR=/tmp/build/libpng
  51. #
  52. # If you're going to install into a temporary location
  53. # via DESTDIR, $(DESTDIR)$(prefix) must already exist before
  54. # you execute make install.
  55. DESTDIR=
  56. DB=$(DESTDIR)$(BINPATH)
  57. DI=$(DESTDIR)$(INCPATH)
  58. DL=$(DESTDIR)$(LIBPATH)
  59. DM=$(DESTDIR)$(MANPATH)
  60. OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
  61. pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
  62. pngwtran.o pngmem.o pngerror.o pngpread.o
  63. OBJSDLL = $(OBJS)
  64. .SUFFIXES: .c .o
  65. all: libpng.a $(LIBSO) pngtest libpng.pc libpng-config
  66. # try include scripts/pnglibconf.mak for more options
  67. pnglibconf.h: scripts/pnglibconf.h.prebuilt
  68. cp scripts/pnglibconf.h.prebuilt $@
  69. libpng.a: $(OBJS)
  70. $(AR_RC) $@ $(OBJS)
  71. $(RANLIB) $@
  72. libpng.pc:
  73. cat scripts/libpng.pc.in | sed -e s!@prefix@!$(prefix)! \
  74. -e s!@exec_prefix@!$(exec_prefix)! \
  75. -e s!@libdir@!$(LIBPATH)! \
  76. -e s!@includedir@!$(INCPATH)! \
  77. -e s!-lpng15!-lpng15\ -lz\ -lm! > libpng.pc
  78. libpng-config:
  79. ( cat scripts/libpng-config-head.in; \
  80. echo prefix=\"$(prefix)\"; \
  81. echo I_opts=\"-I$(INCPATH)/$(LIBNAME)\"; \
  82. echo libs=\"-lpng15 -lz \"; \
  83. cat scripts/libpng-config-body.in ) > libpng-config
  84. chmod +x libpng-config
  85. $(LIBSO): $(LIBSOMAJ)
  86. $(LN_SF) $(LIBSOMAJ) $(LIBSO)
  87. cp $(LIBSO)* /boot/home/config/lib
  88. $(LIBSOMAJ): $(OBJSDLL)
  89. $(CC) -nostart -Wl,-soname,$(LIBSOMAJ) -o \
  90. $(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS)
  91. pngtest: pngtest.o $(LIBSO)
  92. $(CC) -L$(ZLIBLIB) -L. -lz -lpng15 -o pngtest pngtest.o
  93. test: pngtest
  94. ./pngtest
  95. install-headers: png.h pngconf.h pnglibconf.h
  96. -@if [ ! -d $(DI) ]; then $(MKDIR_P) $(DI); fi
  97. -@if [ ! -d $(DI)/$(LIBNAME) ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
  98. cp png.h pngconf.h pnglibconf.h $(DI)/$(LIBNAME)
  99. chmod 644 $(DI)/$(LIBNAME)/png.h $(DI)/$(LIBNAME)/pngconf.h $(DI)/$(LIBNAME)/pnglibconf.h
  100. -@$(RM_F) $(DI)/png.h $(DI)/pngconf.h $(DI)/pnglibconf.h
  101. -@$(RM_F) $(DI)/libpng
  102. (cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
  103. install-static: install-headers libpng.a
  104. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  105. cp libpng.a $(DL)/$(LIBNAME).a
  106. chmod 644 $(DL)/$(LIBNAME).a
  107. -@$(RM_F) $(DL)/libpng.a
  108. (cd $(DL); $(LN_SF) $(LIBNAME).a libpng.a)
  109. install-shared: install-headers $(LIBSOMAJ) libpng.pc
  110. -@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
  111. -@$(RM_F) $(DL)/$(LIBSO)
  112. -@$(RM_F) $(DL)/$(LIBSOREL)
  113. -@$(RM_F) $(DL)/$(OLDSO)
  114. cp $(LIBSOMAJ) $(DL)/$(LIBSOREL)
  115. chmod 755 $(DL)/$(LIBSOREL)
  116. (cd $(DL); \
  117. $(LN_SF) $(LIBSOREL) $(LIBSO); \
  118. $(LN_SF) $(LIBSO) $(OLDSO))
  119. -@if [ ! -d $(DL)/pkgconfig ]; then $(MKDIR_P) $(DL)/pkgconfig; fi
  120. -@$(RM_F) $(DL)/pkgconfig/$(LIBNAME).pc
  121. -@$(RM_F) $(DL)/pkgconfig/libpng.pc
  122. cp libpng.pc $(DL)/pkgconfig/$(LIBNAME).pc
  123. chmod 644 $(DL)/pkgconfig/$(LIBNAME).pc
  124. (cd $(DL)/pkgconfig; $(LN_SF) $(LIBNAME).pc libpng.pc)
  125. install-man: libpng.3 libpngpf.3 png.5
  126. -@if [ ! -d $(DM) ]; then $(MKDIR_P) $(DM); fi
  127. -@if [ ! -d $(DM)/man3 ]; then $(MKDIR_P) $(DM)/man3; fi
  128. -@$(RM_F) $(DM)/man3/libpng.3
  129. -@$(RM_F) $(DM)/man3/libpngpf.3
  130. cp libpng.3 $(DM)/man3
  131. cp libpngpf.3 $(DM)/man3
  132. -@if [ ! -d $(DM)/man5 ]; then $(MKDIR_P) $(DM)/man5; fi
  133. -@$(RM_F) $(DM)/man5/png.5
  134. cp png.5 $(DM)/man5
  135. install-config: libpng-config
  136. -@if [ ! -d $(DB) ]; then $(MKDIR_P) $(DB); fi
  137. -@$(RM_F) $(DB)/libpng-config
  138. -@$(RM_F) $(DB)/$(LIBNAME)-config
  139. cp libpng-config $(DB)/$(LIBNAME)-config
  140. chmod 755 $(DB)/$(LIBNAME)-config
  141. (cd $(DB); $(LN_SF) $(LIBNAME)-config libpng-config)
  142. install: install-static install-shared install-man install-config
  143. # If you installed in $(DESTDIR), test-installed won't work until you
  144. # move the library to its final location. Use test-dd to test it
  145. # before then.
  146. test-dd:
  147. echo
  148. echo Testing installed dynamic shared library in $(DL).
  149. $(CC) -I$(DI) $(CFLAGS) \
  150. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  151. -L$(DL) -L$(ZLIBLIB) -Wl,-rpath $(ZLIBLIB):$(DL) \
  152. -o pngtestd `$(BINPATH)/$(LIBNAME)-config --ldflags`
  153. ./pngtestd pngtest.png
  154. test-installed:
  155. $(CC) $(CFLAGS) \
  156. `$(BINPATH)/$(LIBNAME)-config --cflags` pngtest.c \
  157. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) \
  158. -o pngtesti `$(BINPATH)/$(LIBNAME)-config --ldflags`
  159. ./pngtesti pngtest.png
  160. clean:
  161. $(RM_F) *.o libpng.a pngtest pngout.png libpng-config \
  162. $(LIBSO) $(LIBSOMAJ)* pngtesti \
  163. pnglibconf.h libpng.pc
  164. # DO NOT DELETE THIS LINE -- make depend depends on it.
  165. png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  166. pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  167. pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  168. pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  169. pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  170. pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  171. pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  172. pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  173. pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  174. pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  175. pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  176. pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  177. pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  178. pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  179. pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
  180. pngtest.o: png.h pngconf.h pnglibconf.h