Imported Upstream version 1.6.39
[platform/upstream/libpng.git] / scripts / makefile.sgi
1 # makefile for libpng.a and libpng16.so, SGI IRIX with 'cc'
2 # Copyright (C) 2020-2022 Cosmin Truta
3 # Copyright (C) 2001-2002, 2006, 2007, 2010-2014 Glenn Randers-Pehrson
4 # Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
5 #
6 # This code is released under the libpng license.
7 # For conditions of distribution and use, see the disclaimer
8 # and license in png.h
9
10 # Library name:
11 LIBNAME=libpng16
12 PNGMAJ=16
13
14 # Shared library names:
15 LIBSO=$(LIBNAME).so
16 LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
17
18 # Utilities:
19 CC=cc
20 AR_RC=ar rc
21 RANLIB=echo
22 MKDIR_P=mkdir -p
23 LN_SF=ln -sf
24 CP=cp
25 RM_F=/bin/rm -f
26
27 # Where the zlib library and include files are located
28 #ZLIBLIB=/usr/local/lib32
29 #ZLIBINC=/usr/local/include
30 #ZLIBLIB=/usr/local/lib
31 #ZLIBINC=/usr/local/include
32 ZLIBLIB=../zlib
33 ZLIBINC=../zlib
34
35 # ABI can be blank to use default for your system, -32, -o32, -n32, or -64
36 # See "man abi".  zlib must be built with the same ABI.
37 ABI=
38
39 WARNMORE=-fullwarn
40 # Note: -KPIC is the default anyhow
41 CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
42 #CFLAGS= $(ABI) -O $(WARNMORE) -KPIC # -g
43 CFLAGS=$(ABI) -O $(WARNMORE) # -g
44 LDFLAGS_A=$(ABI) -L. -L$(ZLIBLIB) -lpng16 -lz -lm # -g
45 LDFLAGS=$(ABI) -L. -L$(ZLIBLIB) -lpng -lz -lm # -g
46 LDSHARED=cc $(ABI) -shared -soname $(LIBSOMAJ) \
47         -set_version sgi$(PNGMAJ).0
48 # See "man dso" for info about shared objects
49
50 # Pre-built configuration
51 # See scripts/pnglibconf.mak for more options
52 PNGLIBCONF_H_PREBUILT = scripts/pnglibconf.h.prebuilt
53
54 OBJS = png.o pngerror.o pngget.o pngmem.o pngpread.o \
55        pngread.o pngrio.o pngrtran.o pngrutil.o pngset.o \
56        pngtrans.o pngwio.o pngwrite.o pngwtran.o pngwutil.o
57
58 .c.o:
59         $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $<
60
61 all: libpng.a pngtest shared
62
63 pnglibconf.h: $(PNGLIBCONF_H_PREBUILT)
64         $(CP) $(PNGLIBCONF_H_PREBUILT) $@
65
66 libpng.a: $(OBJS)
67         $(AR_RC) $@ $(OBJS)
68         $(RANLIB) $@
69
70 $(LIBSO): $(LIBSOMAJ)
71         $(LN_SF) $(LIBSOMAJ) $(LIBSO)
72
73 $(LIBSOMAJ): $(OBJS)
74         $(LDSHARED) -o $@ $(OBJS)
75         $(RM_F) $(LIBSO) $(LIBSOMAJ)
76
77 pngtest: pngtest.o libpng.a
78         $(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
79
80 test: pngtest
81         echo
82         echo Testing local static library.
83         ./pngtest
84
85 install:
86         @echo "The $@ target is no longer supported by this makefile."
87         @false
88
89 install-static:
90         @echo "The $@ target is no longer supported by this makefile."
91         @false
92
93 install-shared:
94         @echo "The $@ target is no longer supported by this makefile."
95         @false
96
97 clean:
98         $(RM_F) *.o libpng.a pngtest pngout.png
99         $(RM_F) $(LIBSO) $(LIBSOMAJ)* so_locations pnglibconf.h
100
101 # DO NOT DELETE THIS LINE -- make depend depends on it.
102
103 png.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
104 pngerror.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
105 pngget.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
106 pngmem.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
107 pngpread.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
108 pngread.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
109 pngrio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
110 pngrtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
111 pngrutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
112 pngset.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
113 pngtrans.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
114 pngwio.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115 pngwrite.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116 pngwtran.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117 pngwutil.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118
119 pngtest.o:  png.h pngconf.h pnglibconf.h