xref: /aosp_15_r20/external/libpng/scripts/makefile.hpgcc (revision a67afe4df73cf47866eedc69947994b8ff839aba)
1# makefile for libpng on HP-UX using GCC with the HP ANSI/C linker.
2# Copyright (C) 2020-2024 Cosmin Truta
3# Copyright (C) 2002, 2006-2008, 2010-2014 Glenn Randers-Pehrson
4# Copyright (C) 2001, Laurent faillie
5# Copyright (C) 1998, 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).sl
18LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
19
20# Utilities:
21CC=gcc
22AR=ar
23RANLIB=ranlib
24LD=ld
25LN_SF=ln -sf
26CP=cp
27RM_F=/bin/rm -f
28
29# Where the zlib library and include files are located
30ZLIBLIB=/opt/zlib/lib
31ZLIBINC=/opt/zlib/include
32
33# Note that if you plan to build a libpng shared library, zlib must also
34# be a shared library, which zlib's configure does not do.  After running
35# zlib's configure, edit the appropriate lines of makefile to read:
36#   CFLAGS=-O1 -DHAVE_UNISTD -DUSE_MAP -fPIC \
37#   LDSHARED=ld -b
38#   SHAREDLIB=libz.sl
39
40WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
41	-Wmissing-declarations -Wtraditional -Wcast-align \
42	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
43
44CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
45CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
46ARFLAGS=rc
47#LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
48LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
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) -fPIC -o $@ $*.c
63
64all: libpng.a $(LIBSO) pngtest
65
66libpng.a: $(OBJS)
67	$(AR) $(ARFLAGS) $@ $(OBJS)
68	$(RANLIB) $@
69
70$(LIBSO): $(LIBSOMAJ)
71	$(LN_SF) $(LIBSOMAJ) $(LIBSO)
72
73$(LIBSOMAJ): $(OBJSDLL)
74	$(LD) -b +s \
75	+h $(LIBSOMAJ) -o $(LIBSOMAJ) $(OBJSDLL)
76
77pngtest: pngtest.o $(LIBSO)
78	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
79
80test: pngtest
81	./pngtest
82
83install:
84	@echo "The $@ target is no longer supported by this makefile."
85	@false
86
87install-static:
88	@echo "The $@ target is no longer supported by this makefile."
89	@false
90
91install-shared:
92	@echo "The $@ target is no longer supported by this makefile."
93	@false
94
95clean:
96	$(RM_F) *.o libpng.a pngtest pngout.png
97	$(RM_F) $(LIBSO) $(LIBSOMAJ)* pnglibconf.h
98
99# DO NOT DELETE THIS LINE -- make depend depends on it.
100
101png.o      png.pic.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
102pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
103pngget.o   pngget.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
104pngmem.o   pngmem.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106pngread.o  pngread.pic.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107pngrio.o   pngrio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110pngset.o   pngset.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112pngwio.o   pngwio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116
117pngtest.o: png.h pngconf.h pnglibconf.h
118