makefile.aix 3.1 KB
Newer Older
1
# makefile for libpng using gcc (generic, static library)
2
# Copyright (C) 2002, 2006-2009 Glenn Randers-Pehrson
3 4
# Copyright (C) 2000 Cosmin Truta
# Copyright (C) 2000 Marc O. Gloor (AIX support added, from makefile.gcc)
5
# Copyright (C) 1995 Guy Eric Schalnat, Group 42, Inc.
6
#
7
# This code is released under the zlib/libpng license.
8
# For conditions of distribution and use, see the disclaimer
9
# and license in png.h
10 11 12 13 14 15 16 17

# Location of the zlib library and include files
ZLIBINC = ../zlib
ZLIBLIB = ../zlib

# Compiler, linker, lib and other tools
CC = gcc
LD = $(CC)
18
AR_RC = ar rcs
19
MKDIR_P = mkdir -p
20
RANLIB = ranlib
21 22
RM_F = rm -f
LN_SF = ln -f -s
23

24
LIBNAME=libpng14
25
PNGMAJ = 14
26
PNGMIN = 1.4.0beta65
27 28 29 30 31 32
PNGVER = $(PNGMAJ).$(PNGMIN)

prefix=/usr/local
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib

33 34 35 36 37 38
# override DESTDIR= on the make install command line to easily support
# installing into a temporary location.  Example:
#
#    make install DESTDIR=/tmp/build/libpng
#
# If you're going to install into a temporary location
39
# via DESTDIR, $(DESTDIR)$(prefix) must already exist before
40 41 42
# you execute make install.
DESTDIR=

43 44
DI=$(DESTDIR)$(INCPATH)
DL=$(DESTDIR)$(LIBPATH)
45

46 47 48 49
CDEBUG = -g -DPNG_DEBUG=5
LDDEBUG =
CRELEASE = -O2
LDRELEASE = -s
50
WARNMORE=-W -Wall
51
CFLAGS = -I$(ZLIBINC) $(WARNMORE) $(CRELEASE)
52
LDFLAGS = -L. -L$(ZLIBLIB) -lpng14 -lz -lm $(LDRELEASE)
53 54 55 56 57 58 59

# File extensions
O=.o
A=.a
E=

# Variables
60
OBJS =  png$(O) pngerror$(O) pngget$(O) pngmem$(O) pngpread$(O) \
61
	pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) pngset$(O) \
62
	pngtrans$(O) pngwio$(O) pngwrite$(O) pngwtran$(O) pngwutil$(O)
63 64

# Targets
65
all: $(LIBNAME)$(A) pngtest$(E)
66

67
$(LIBNAME)$(A): $(OBJS)
68
	$(AR_RC) $@ $(OBJS)
69 70 71 72 73
	$(RANLIB) $@

test: pngtest$(E)
	./pngtest$(E)

74
pngtest$(E): pngtest$(O) $(LIBNAME)$(A)
75 76
	$(LD) -o $@ pngtest$(O) $(LDFLAGS)

77
install: $(LIBNAME)$(A)
78 79 80
	-@if [ ! -d $(DI)  ]; then $(MKDIR_P) $(DI); fi
	-@if [ ! -d $(DI)/$(LIBNAME)  ]; then $(MKDIR_P) $(DI)/$(LIBNAME); fi
	-@if [ ! -d $(DL) ]; then $(MKDIR_P) $(DL); fi
81 82 83 84
	-@$(RM_F) $(DI)/$(LIBNAME)/png.h
	-@$(RM_F) $(DI)/$(LIBNAME)/pngconf.h
	-@$(RM_F) $(DI)/png.h
	-@$(RM_F) $(DI)/pngconf.h
85 86 87
	cp png.h pngconf.h $(DI)/$(LIBNAME)
	chmod 644 $(DI)/$(LIBNAME)/png.h \
	$(DI)/$(LIBNAME)/pngconf.h
88 89 90 91
	-@$(RM_F) -r $(DI)/libpng
	(cd $(DI); $(LN_SF) $(LIBNAME) libpng; $(LN_SF) $(LIBNAME)/* .)
	-@$(RM_F) $(DL)/$(LIBNAME)$(A)
	-@$(RM_F) $(DL)/libpng$(A)
92 93
	cp $(LIBNAME)$(A) $(DL)/$(LIBNAME)$(A)
	chmod 644 $(DL)/$(LIBNAME)$(A)
94 95
	(cd $(DL); $(LN_SF) $(LIBNAME)$(A) libpng$(A))
	(cd $(DI); $(LN_SF) libpng/* .;)
96 97

clean:
98
	$(RM_F) *.o $(LIBNAME)$(A) pngtest pngout.png
99

100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
png$(O):      png.h pngconf.h pngpriv.h
pngerror$(O): png.h pngconf.h pngpriv.h
pngget$(O):   png.h pngconf.h pngpriv.h
pngmem$(O):   png.h pngconf.h pngpriv.h
pngpread$(O): png.h pngconf.h pngpriv.h
pngread$(O):  png.h pngconf.h pngpriv.h
pngrio$(O):   png.h pngconf.h pngpriv.h
pngrtran$(O): png.h pngconf.h pngpriv.h
pngrutil$(O): png.h pngconf.h pngpriv.h
pngset$(O):   png.h pngconf.h pngpriv.h
pngtrans$(O): png.h pngconf.h pngpriv.h
pngwio$(O):   png.h pngconf.h pngpriv.h
pngwrite$(O): png.h pngconf.h pngpriv.h
pngwtran$(O): png.h pngconf.h pngpriv.h
pngwutil$(O): png.h pngconf.h pngpriv.h
115 116

pngtest$(O):  png.h pngconf.h pngpriv.h