• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# makefile for libpng on Solaris 2.x with cc
2# Contributed by William L. Sebok, based on makefile.linux
3# Copyright (C) 2020-2022 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:
13LIBNAME=libpng16
14PNGMAJ=16
15
16# Shared library names:
17LIBSO=$(LIBNAME).so
18LIBSOMAJ=$(LIBNAME).so.$(PNGMAJ)
19
20# Utilities:
21CC=cc
22AR_RC=ar rc
23RANLIB=echo
24MKDIR_P=mkdir -p
25LN_SF=ln -f -s
26RM_F=/bin/rm -f
27
28SUN_CC_FLAGS=-fast -xtarget=ultra
29SUN_LD_FLAGS=-fast -xtarget=ultra
30
31# Where the zlib library and include files are located
32# Changing these to ../zlib poses a security risk.  If you want
33# to have zlib in an adjacent directory, specify the full path instead of "..".
34#ZLIBLIB=../zlib
35#ZLIBINC=../zlib
36
37ZLIBLIB=/usr/lib
38ZLIBINC=/usr/include
39
40WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
41	-Wmissing-declarations -Wtraditional -Wcast-align \
42	-Wstrict-prototypes -Wmissing-prototypes # -Wconversion
43CPPFLAGS=-I$(ZLIBINC) # -DPNG_DEBUG=5
44CFLAGS=$(SUN_CC_FLAGS) # $(WARNMORE) -g
45LDFLAGS=$(SUN_LD_FLAGS) -L$(ZLIBLIB) -R$(ZLIBLIB) libpng.a -lz -lm
46
47OBJS = 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
51OBJSDLL = $(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
61all: libpng.a $(LIBSO) pngtest
62
63include scripts/pnglibconf.mak
64DELETE = $(RM_F)
65DFNFLAGS = $(DEFS) $(CPPFLAGS)
66
67libpng.a: $(OBJS)
68	$(AR_RC) $@ $(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
90pngtest: pngtest.o $(LIBSO)
91	$(CC) -o pngtest $(CFLAGS) pngtest.o $(LDFLAGS)
92
93test: pngtest
94	./pngtest
95
96install:
97	@echo "The $@ target is no longer supported by this makefile."
98	@false
99
100install-static:
101	@echo "The $@ target is no longer supported by this makefile."
102	@false
103
104install-shared:
105	@echo "The $@ target is no longer supported by this makefile."
106	@false
107
108clean:
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
114png.o      png.pic.o:      png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
115pngerror.o pngerror.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
116pngget.o   pngget.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
117pngmem.o   pngmem.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
118pngpread.o pngpread.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
119pngread.o  pngread.pic.o:  png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
120pngrio.o   pngrio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
121pngrtran.o pngrtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
122pngrutil.o pngrutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
123pngset.o   pngset.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
124pngtrans.o pngtrans.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
125pngwio.o   pngwio.pic.o:   png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
126pngwrite.o pngwrite.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
127pngwtran.o pngwtran.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
128pngwutil.o pngwutil.pic.o: png.h pngconf.h pnglibconf.h pngpriv.h pngstruct.h pnginfo.h pngdebug.h
129
130pngtest.o: png.h pngconf.h pnglibconf.h
131