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:
|
---|
13 | LIBNAME=libpng16
|
---|
14 | PNGMAJ=16
|
---|
15 |
|
---|
16 | # Shared library names:
|
---|
17 | LIBSO=$(LIBNAME).sl
|
---|
18 | LIBSOMAJ=$(LIBNAME).sl.$(PNGMAJ)
|
---|
19 |
|
---|
20 | # Utilities:
|
---|
21 | CC=gcc
|
---|
22 | AR=ar
|
---|
23 | RANLIB=ranlib
|
---|
24 | LD=ld
|
---|
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=/opt/zlib/lib
|
---|
31 | ZLIBINC=/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 |
|
---|
40 | WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
---|
41 | -Wmissing-declarations -Wtraditional -Wcast-align \
|
---|
42 | -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
|
---|
43 |
|
---|
44 | CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
---|
45 | CFLAGS=-O3 -funroll-loops -Wall -Wextra -Wundef # $(WARNMORE) -g
|
---|
46 | ARFLAGS=rc
|
---|
47 | #LDFLAGS=-L. -Wl,-rpath,. -L$(ZLIBLIB) -Wl,-rpath,$(ZLIBLIB) -lpng16 -lz -lm # -g
|
---|
48 | LDFLAGS=-L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
|
---|
49 |
|
---|
50 | OBJS = 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 |
|
---|
54 | OBJSDLL = $(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 |
|
---|
64 | all: libpng.a $(LIBSO) pngtest
|
---|
65 |
|
---|
66 | libpng.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 |
|
---|
77 | pngtest: pngtest.o $(LIBSO)
|
---|
78 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
---|
79 |
|
---|
80 | test: pngtest
|
---|
81 | ./pngtest
|
---|
82 |
|
---|
83 | install:
|
---|
84 | @echo "The $@ target is no longer supported by this makefile."
|
---|
85 | @false
|
---|
86 |
|
---|
87 | install-static:
|
---|
88 | @echo "The $@ target is no longer supported by this makefile."
|
---|
89 | @false
|
---|
90 |
|
---|
91 | install-shared:
|
---|
92 | @echo "The $@ target is no longer supported by this makefile."
|
---|
93 | @false
|
---|
94 |
|
---|
95 | clean:
|
---|
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 |
|
---|
101 | png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
102 | pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
103 | pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
104 | pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
105 | pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
106 | pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
107 | pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
108 | pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
109 | pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
110 | pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
111 | pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
112 | pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
113 | pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
114 | pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
115 | pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
116 |
|
---|
117 | pngtest.o: png.h pngconf.h pnglibconf.h
|
---|