xref: /aosp_15_r20/external/libpng/scripts/makefile.sco (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1# makefile for SCO OSr5  ELF and Unixware 7 with Native cc
2# Contributed by Mike Hopkirk (hops at sco.com) modified from Makefile.lnx
3#   force ELF build dynamic linking, SONAME setting in lib and RPATH in app
4# Copyright (C) 2020-2024 Cosmin Truta
5# Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
6# Copyright (C) 1998 Greg Roelofs
7# Copyright (C) 1996, 1997 Andreas Dilger
8#
9# This code is released under the libpng license.
10# For conditions of distribution and use, see the disclaimer
11# and license in png.h
12
13# Library name:
14LIBNAME=libpng16
15PNGMAJ=16
16
17# Shared library names:
18LIBSO=$(LIBNAME).so
19LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
20
21# Utilities:
22CC=cc
23AR=ar
24RANLIB=echo
25LN_SF=ln -f -s
26CP=cp
27RM_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
32ZLIBLIB=../zlib
33ZLIBINC=../zlib
34
35CPPFLAGS=-I$(ZLIBINC)
36CFLAGS=-dy -belf -O3
37ARFLAGS=rc
38LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm
39
40# Pre-built configuration
41# See scripts/pnglibconf.mak for more options
42PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
43
44OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
45       pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
46       pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
47
48OBJSDLL = $(OBJS:.o=.pic.o)
49
50.SUFFIXES:      .c .o .pic.o
51
52.c.o:
53	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
54
55.c.pic.o:
56	$(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
57
58all: libpng.a $(LIBSO) pngtest
59
60pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
61	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
62
63libpng.a: $(OBJS)
64	$(AR) $(ARFLAGS) $@ $(OBJS)
65	$(RANLIB) $@
66
67$(LIBSO): $(LIBSOMAJ)
68	$(LN_SF) $(LIBSOMAJ) $(LIBSO)
69
70$(LIBSOMAJ): $(OBJSDLL)
71	$(CC) -G  -Wl,-h,$(LIBSOMAJ) -o $(LIBSOMAJ) \
72	 $(OBJSDLL)
73
74pngtest: pngtest.o $(LIBSO)
75	LD_RUN_PATH=.:$(ZLIBLIB) $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
76
77test: pngtest
78	./pngtest
79
80install:
81	@echo "The $@ target is no longer supported by this makefile."
82	@false
83
84install-static:
85	@echo "The $@ target is no longer supported by this makefile."
86	@false
87
88install-shared:
89	@echo "The $@ target is no longer supported by this makefile."
90	@false
91
92clean:
93	$(RM_F) *.o libpng.a pngtest pngout.png
94	$(RM_F) $(LIBSO) $(LIBSOMAJ)* pngtest-static pnglibconf.h
95
96# DO NOT DELETE THIS LINE -- make depend depends on it.
97
98png.o      png.pic.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
99pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
100pngget.o   pngget.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
101pngmem.o   pngmem.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
102pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
103pngread.o  pngread.pic.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
104pngrio.o   pngrio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107pngset.o   pngset.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109pngwio.o   pngwio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113
114pngtest.o: png.h pngconf.h pnglibconf.h
115