]> git.tdb.fi Git - ext/libpng.git/blob - scripts/makefile.beos
Import libpng 1.6.39
[ext/libpng.git] / scripts / makefile.beos
1 # makefile for libpng on BeOS x86 ELF with gcc
2 # modified from makefile.linux by Sander Stoks
3 # Copyright (C) 2020-2022 Cosmin Truta
4 # Copyright (C) 2002, 2006, 2008, 2010-2014 Glenn Randers-Pehrson
5 # Copyright (C) 1999 Greg Roelofs
6 # Copyright (C) 1996, 1997 Andreas Dilger
7 #
8 # This code is released under the libpng license.
9 # For conditions of distribution and use, see the disclaimer
10 # and license in png.h
11
12 # Library name:
13 LIBNAME=libpng16
14 PNGMAJ=16
15
16 # Shared library names:
17 LIBSO=$(LIBNAME).so
18 LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
19
20 # Utilities:
21 CC=gcc
22 AR_RC=ar rc
23 RANLIB=ranlib
24 MKDIR_P=mkdir -p
25 LN_SF=ln -sf
26 CP=cp
27 RM_F=/bin/rm -f
28
29 # Where the zlib library and include files are located
30 ZLIBLIB=/usr/local/lib
31 ZLIBINC=/usr/local/include
32
33 ALIGN=
34 # For i386:
35 # ALIGN=-malign-loops=2 -malign-functions=2
36
37 WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
38         -Wmissing-declarations -Wtraditional -Wcast-align \
39         -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
40
41 # On BeOS, -O1 is actually better than -O3.  This is a known bug but it's
42 # still here in R4.5
43 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
44 CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
45 # LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
46 LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
47
48 # Pre-built configuration
49 # See scripts/pnglibconf.mak for more options
50 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
51
52 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
53        pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
54        pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
55
56 OBJSDLL = $(OBJS)
57
58 .SUFFIXES:      .c .o
59
60 .c.o:
61         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
62
63 all: libpng.a $(LIBSO) pngtest
64
65 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
66         $(CP) $(PNGLIBCONF_H_PREBUILT) $@
67
68 libpng.a: $(OBJS)
69         $(AR_RC) $@ $(OBJS)
70         $(RANLIB) $@
71
72 $(LIBSO): $(LIBSOMAJ)
73         $(LN_SF) $(LIBSOMAJ) $(LIBSO)
74         cp $(LIBSO)* /boot/home/config/lib
75
76 $(LIBSOMAJ): $(OBJSDLL)
77         $(CC) -nostart -Wl,-soname,$(LIBSOMAJ) \
78          -o $(LIBSOMAJ) $(OBJSDLL) $(LDFLAGS)
79
80 pngtest: pngtest.o $(LIBSO)
81         $(CC) -L$(ZLIBLIB) -L. -lz -lpng16 -o pngtest pngtest.o
82
83 test: pngtest
84         ./pngtest
85
86 install:
87         @echo "The $@ target is no longer supported by this makefile."
88         @false
89
90 install-static:
91         @echo "The $@ target is no longer supported by this makefile."
92         @false
93
94 install-shared:
95         @echo "The $@ target is no longer supported by this makefile."
96         @false
97
98 clean:
99         $(RM_F) *.o libpng.a pngtest pngout.png
100         $(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
101
102 # DO NOT DELETE THIS LINE -- make depend depends on it.
103
104 png.o      png.pic.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105 pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106 pngget.o   pngget.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107 pngmem.o   pngmem.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108 pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109 pngread.o  pngread.pic.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110 pngrio.o   pngrio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111 pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112 pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113 pngset.o   pngset.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114 pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115 pngwio.o   pngwio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117 pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118 pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119
120 pngtest.o: png.h pngconf.h pnglibconf.h