xref: /aosp_15_r20/external/libpng/scripts/makefile.hp64 (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1# makefile for libpng, HPUX (10.20 and 11.00) using the ANSI/C product.
2# Copyright (C) 2020-2024 Cosmin Truta
3# Copyright (C) 1999-2002, 2006, 2009, 2010-2014 Glenn Randers-Pehrson
4# Copyright (C) 1995 Guy Eric Schalnat, Group 42
5# Contributed by Jim Rice and updated by Chris Schleicher, Hewlett Packard
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
11# Where the zlib library and include files are located
12ZLIBLIB=/opt/zlib/lib
13ZLIBINC=/opt/zlib/include
14
15# Note that if you plan to build a libpng shared library, zlib must also
16# be a shared library, which zlib's configure does not do.  After running
17# zlib's configure, edit the appropriate lines of makefile to read:
18#   CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
19#   LDSHARED=ld -b
20#   SHAREDLIB=libz.sl
21
22# Library name:
23LIBNAME=libpng16
24PNGMAJ=16
25
26# Shared library names:
27LIBSO=$(LIBNAME).sl
28LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
29
30# Utilities:
31CC=cc
32AR=ar
33RANLIB=ranlib
34LN_SF=ln -sf
35CP=cp
36RM_F=/bin/rm -f
37
38CPPFLAGS=-I$(ZLIBINC) \
39        -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_UNISTD_H -DUSE_MMAP
40CFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
41# Caution: be sure you have built zlib with the same CFLAGS.
42CCFLAGS=-O -Ae -Wl,+vnocompatwarnings +DD64 +Z
43ARFLAGS=rc
44LDFLAGS=-L. -L$(ZLIBLIB) -lpng -lz -lm
45
46# Pre-built configuration
47# See scripts/pnglibconf.mak for more options
48PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
49
50OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
51       pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
52       pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
53
54OBJSDLL = $(OBJS:.o=.pic.o)
55
56.SUFFIXES:	.c .o .pic.o
57
58.c.o:
59	$(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
60
61.c.pic.o:
62	$(CC) -c $(CPPFLAGS) $(CFLAGS) +z -o $@ $*.c
63
64all: libpng.a $(LIBSO) pngtest
65
66pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
67	$(CP) $(PNGLIBCONF_H_PREBUILT) $@
68
69libpng.a: $(OBJS)
70	$(AR) $(ARFLAGS) $@ $(OBJS)
71	$(RANLIB) $@
72
73$(LIBSO): $(LIBSOMAJ)
74	$(LN_SF) $(LIBSOMAJ) $(LIBSO)
75
76$(LIBSOMAJ): $(OBJSDLL)
77	$(LD) -b +s \
78	+h $(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
79
80pngtest: pngtest.o libpng.a
81	$(CC) -o pngtest $(CCFLAGS) pngtest.o $(LDFLAGS)
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.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106pngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107pngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109pngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110pngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113pngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115pngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118pngwutil.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