xref: /aosp_15_r20/external/libpng/scripts/makefile.beos (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1# makefile for libpng on BeOS x86 ELF with gcc
2# modified from makefile.linux by Sander Stoks
3# Copyright (C) 2020-2024 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:
13LIBNAME=libpng16
14PNGMAJ=16
15
16# Shared library names:
17LIBSO=$(LIBNAME).so
18LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
19
20# Utilities:
21CC=gcc
22AR=ar
23RANLIB=ranlib
24LN_SF=ln -sf
25CP=cp
26RM_F=/bin/rm -f
27
28# Where the zlib library and include files are located
29ZLIBLIB=/usr/local/lib
30ZLIBINC=/usr/local/include
31
32ALIGN=
33# For i386:
34# ALIGN=-malign-loops=2 -malign-functions=2
35
36WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
37	-Wmissing-declarations -Wtraditional -Wcast-align \
38	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
39
40# On BeOS, -O1 is actually better than -O3.  This is a known bug but it's
41# still here in R4.5
42CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
43CFLAGS=-O1 -funroll-loops $(ALIGN) -Wall -Wextra -Wundef # $(WARNMORE) -g
44ARFLAGS=rc
45# LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng -lz
46LDFLAGS=-L. -Wl,-soname=$(LIBSOMAJ) -L$(ZLIBLIB) -lz # -g
47
48# Pre-built configuration
49# See scripts/pnglibconf.mak for more options
50PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
51
52OBJS = 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
56OBJSDLL = $(OBJS)
57
58.SUFFIXES:      .c .o
59
60.c.o:
61	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
62
63all: libpng.a $(LIBSO) pngtest
64
65pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
66	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
67
68libpng.a: $(OBJS)
69	$(AR) $(ARFLAGS) $@ $(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
80pngtest: pngtest.o $(LIBSO)
81	$(CC) -L$(ZLIBLIB) -L. -lz -lpng16 -o pngtest pngtest.o
82
83test: pngtest
84	./pngtest
85
86install:
87	@echo "The $@ target is no longer supported by this makefile."
88	@false
89
90install-static:
91	@echo "The $@ target is no longer supported by this makefile."
92	@false
93
94install-shared:
95	@echo "The $@ target is no longer supported by this makefile."
96	@false
97
98clean:
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
104png.o      png.pic.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106pngget.o   pngget.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107pngmem.o   pngmem.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109pngread.o  pngread.pic.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110pngrio.o   pngrio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113pngset.o   pngset.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115pngwio.o   pngwio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119
120pngtest.o: png.h pngconf.h pnglibconf.h
121