1 | # makefile for libpng on Solaris 2.x with cc
|
---|
2 | # Contributed by William L. Sebok, based on makefile.linux
|
---|
3 | # Copyright (C) 2020-2024 Cosmin Truta
|
---|
4 | # Copyright (C) 2002, 2006, 2010-2014 Glenn Randers-Pehrson
|
---|
5 | # Copyright (C) 1998 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).so
|
---|
18 | LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
|
---|
19 |
|
---|
20 | # Utilities:
|
---|
21 | CC=cc
|
---|
22 | AR=ar
|
---|
23 | RANLIB=echo
|
---|
24 | LN_SF=ln -f -s
|
---|
25 | RM_F=/bin/rm -f
|
---|
26 |
|
---|
27 | SUN_CC_FLAGS=-fast -xtarget=ultra -xarch=v9
|
---|
28 | SUN_LD_FLAGS=-fast -xtarget=ultra -xarch=v9
|
---|
29 |
|
---|
30 | # Where the zlib library and include files are located
|
---|
31 | # Changing these to ../zlib poses a security risk. If you want
|
---|
32 | # to have zlib in an adjacent directory, specify the full path instead of "..".
|
---|
33 | #ZLIBLIB=../zlib
|
---|
34 | #ZLIBINC=../zlib
|
---|
35 |
|
---|
36 | ZLIBLIB=/usr/lib
|
---|
37 | ZLIBINC=/usr/include
|
---|
38 |
|
---|
39 | WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
|
---|
40 | -Wmissing-declarations -Wtraditional -Wcast-align \
|
---|
41 | -Wstrict-prototypes -Wmissing-prototypes # -Wconversion
|
---|
42 | CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
|
---|
43 | CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
|
---|
44 | ARFLAGS=rc
|
---|
45 | LDFLAGS=-L. -R. $(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) -lpng16 -lz -lm
|
---|
46 |
|
---|
47 | OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
|
---|
48 | pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
|
---|
49 | pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
|
---|
50 |
|
---|
51 | OBJSDLL = $(OBJS:.o=.pic.o)
|
---|
52 |
|
---|
53 | .SUFFIXES: .c .o .pic.o
|
---|
54 |
|
---|
55 | .c.o:
|
---|
56 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
|
---|
57 |
|
---|
58 | .c.pic.o:
|
---|
59 | $(CC) -c $(CPPFLAGS) $(CFLAGS) -KPIC -o $@ $*.c
|
---|
60 |
|
---|
61 | all: libpng.a $(LIBSO) pngtest
|
---|
62 |
|
---|
63 | include scripts/pnglibconf.mak
|
---|
64 | DELETE = $(RM_F)
|
---|
65 | DFNFLAGS = $(DEFS) $(CPPFLAGS)
|
---|
66 |
|
---|
67 | libpng.a: $(OBJS)
|
---|
68 | $(AR) $(ARFLAGS) $@ $(OBJS)
|
---|
69 | $(RANLIB) $@
|
---|
70 |
|
---|
71 | $(LIBSO): $(LIBSOMAJ)
|
---|
72 | $(LN_SF) $(LIBSOMAJ) $(LIBSO)
|
---|
73 |
|
---|
74 | $(LIBSOMAJ): $(OBJSDLL)
|
---|
75 | @case "`type ld`" in *ucb*) \
|
---|
76 | echo; \
|
---|
77 | echo '## WARNING:'; \
|
---|
78 | echo '## The commands "CC" and "LD" must NOT refer to /usr/ucb/cc'; \
|
---|
79 | echo '## and /usr/ucb/ld. If they do, you need to adjust your PATH'; \
|
---|
80 | echo '## environment variable to put /usr/ccs/bin ahead of /usr/ucb.'; \
|
---|
81 | echo '## The environment variable LD_LIBRARY_PATH should not be set'; \
|
---|
82 | echo '## at all. If it is, things are likely to break because of'; \
|
---|
83 | echo '## the libucb dependency that is created.'; \
|
---|
84 | echo; \
|
---|
85 | ;; \
|
---|
86 | esac
|
---|
87 | $(LD) -G -L$(ZLIBLIB) -R$(ZLIBLIB) -h $(LIBSOMAJ) \
|
---|
88 | -o $(LIBSOMAJ) $(OBJSDLL)
|
---|
89 |
|
---|
90 | pngtest: pngtest.o $(LIBSO)
|
---|
91 | $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
|
---|
92 |
|
---|
93 | test: pngtest
|
---|
94 | ./pngtest
|
---|
95 |
|
---|
96 | install:
|
---|
97 | @echo "The $@ target is no longer supported by this makefile."
|
---|
98 | @false
|
---|
99 |
|
---|
100 | install-static:
|
---|
101 | @echo "The $@ target is no longer supported by this makefile."
|
---|
102 | @false
|
---|
103 |
|
---|
104 | install-shared:
|
---|
105 | @echo "The $@ target is no longer supported by this makefile."
|
---|
106 | @false
|
---|
107 |
|
---|
108 | clean:
|
---|
109 | $(RM_F) *.o libpng.a pngtest pngout.png
|
---|
110 | $(RM_F) $(LIBSO) $(LIBSOMAJ)*
|
---|
111 |
|
---|
112 | # DO NOT DELETE THIS LINE -- make depend depends on it.
|
---|
113 |
|
---|
114 | png.o png.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
115 | pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
116 | pngget.o pngget.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
117 | pngmem.o pngmem.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
118 | pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
119 | pngread.o pngread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
120 | pngrio.o pngrio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
121 | pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
122 | pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
123 | pngset.o pngset.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
124 | pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
125 | pngwio.o pngwio.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
126 | pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
127 | pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
128 | pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
|
---|
129 |
|
---|
130 | pngtest.o: png.h pngconf.h pnglibconf.h
|
---|