libpng/scripts/makefile.cygwin

193 lines
5.6 KiB
Plaintext
Raw Normal View History

2000-07-14 09:15:12 -04:00
# makefile for cygwin on x86
# builds both dll (with import lib) and static lib versions
# of the library, and builds two copies of pngtest: one
# statically linked and one dynamically linked.
2000-11-23 12:51:42 -05:00
#
2000-07-14 09:15:12 -04:00
# based on makefile for linux-elf w/mmx by:
# Copyright (C) 1998-2000 Greg Roelofs
# Copyright (C) 1996, 1997 Andreas Dilger
# For conditions of distribution and use, see copyright notice in png.h
# To enable assembler optimizations, add '-DPNG_USE_PNGGCCRD' to
# $CFLAGS, and include pnggccrd.o in $OBJS, below.
CC=gcc
2002-04-07 17:35:38 -04:00
ifdef MINGW
MINGW_CCFLAGS=-mno-cygwin -I/usr/include/mingw
MINGW_LDFLAGS=-mno-cygwin -L/usr/lib/mingw
endif
2000-07-14 09:15:12 -04:00
2001-01-12 16:13:06 -05:00
# where "make install" puts libpng.a, libpng.so*, png.h, and pngconf.h
2000-07-14 09:15:12 -04:00
prefix=/usr
# Where the zlib library and include files are located
ZLIBLIB=${prefix}/lib
ZLIBINC=${prefix}/include
#ZLIBLIB=../zlib
#ZLIBINC=../zlib
ALIGN=
# for i386:
#ALIGN=-malign-loops=2 -malign-functions=2
WARNMORE=-Wwrite-strings -Wpointer-arith -Wshadow \
-Wmissing-declarations -Wtraditional -Wcast-align \
-Wstrict-prototypes -Wmissing-prototypes #-Wconversion
#CFLAGS=-DPNG_USE_PNGGCCRD -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
# -fomit-frame-pointer # $(WARNMORE) -g -DPNG_DEBUG=5
2002-04-07 17:35:38 -04:00
CFLAGS=$(MINGW_CCFLAGS) -I$(ZLIBINC) -Wall -O3 $(ALIGN) -funroll-loops \
2000-11-23 12:51:42 -05:00
-fomit-frame-pointer
2000-07-14 09:15:12 -04:00
2002-02-22 00:14:23 -05:00
PNGMAJ = 0
#PNGDLL = $12
2002-04-07 17:35:38 -04:00
PNGMIN = 1.2.2rc1
2002-02-22 00:14:23 -05:00
PNGMIN_BASE = 1.2.2
2000-11-10 13:26:19 -05:00
PNGVER = $(PNGMAJ).$(PNGMIN)
2001-01-22 09:52:16 -05:00
SHAREDLIB=cygpng$(PNGDLL).dll
2000-11-10 13:26:19 -05:00
STATLIB=libpng.a
IMPLIB=libpng.dll.a
SHAREDDEF=libpng.def
LIBS=$(SHAREDLIB) $(STATLIB)
EXE=.exe
2002-04-07 17:35:38 -04:00
LDFLAGS=-L. $(MINGW_LDFLAGS) -L$(ZLIBLIB) -lpng -lz
LDSFLAGS=-shared -L. $(MINGW_LDFLAGS) -Wl,--enable-auto-image-base
2000-07-14 09:15:12 -04:00
LDEXTRA=-Wl,--out-implib=$(IMPLIB) $(SHAREDDEF)
RANLIB=ranlib
#RANLIB=echo
INCPATH=$(prefix)/include
LIBPATH=$(prefix)/lib
BINPATH=$(prefix)/bin
MANPATH=$(prefix)/man
MAN3PATH=$(MANPATH)/man3
2001-01-15 13:22:32 -05:00
DOCPATH=$(prefix)/doc/libpng-$(PNGMIN_BASE)
2000-07-14 09:15:12 -04:00
OBJS = png.o pngset.o pngget.o pngrutil.o pngtrans.o pngwutil.o \
pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o \
pngwtran.o pngmem.o pngerror.o pngpread.o # pnggccrd.o
OBJSDLL = $(OBJS:.o=.pic.o)
.SUFFIXES: .c .o .pic.o
%.o : %.c
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $<
%.pic.o : %.c
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ $<
2000-11-10 13:26:19 -05:00
all: all-static all-shared
static: all-static
shared: all-shared
all-static: $(STATLIB) pngtest-stat$(EXE)
all-shared: $(SHAREDLIB) pngtest$(EXE)
2000-07-14 09:15:12 -04:00
2001-01-12 16:13:06 -05:00
pnggccrd.o: png.h pngconf.h
2000-07-14 09:15:12 -04:00
@echo ""
@echo ' You can ignore the single "control reaches end of non-void function"'
@echo ' warning and multiple "<variable> defined but not used" warnings:'
@echo ""
$(CC) -c $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -o $@ $*.c
2001-01-12 16:13:06 -05:00
pnggccrd.pic.o: png.h pngconf.h
2000-07-14 09:15:12 -04:00
@echo ""
@echo ' You can ignore the single "control reaches end of non-void function"'
@echo ' warning and multiple "<variable> defined but not used" warnings:'
@echo ""
2000-11-10 13:26:19 -05:00
$(CC) -c $(CFLAGS) -DPNG_BUILD_DLL -o $@ pnggccrd.c
2000-07-14 09:15:12 -04:00
$(STATLIB): $(OBJS)
ar rc $@ $(OBJS)
$(RANLIB) $@
2001-01-31 06:56:52 -05:00
$(SHAREDDEF): projects/msvc/png32ms.def
2001-05-14 10:20:53 -04:00
cat $< | sed -e '1{G;s/^\(.*\)\(\n\)/EXPORTS/;};2,/^EXPORTS/d' | \
sed -e 's/\([^;]*\);/;/' > $@
2000-07-14 09:15:12 -04:00
$(SHAREDLIB): $(OBJSDLL) $(SHAREDDEF)
2002-04-07 17:35:38 -04:00
$(CC) $(LDSFLAGS) -o $@ $(LDEXTRA) $(OBJSDLL) -L. -L$(ZLIBLIB) -lz
2000-07-14 09:15:12 -04:00
pngtest$(EXE): pngtest.pic.o $(SHAREDLIB)
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
pngtest-stat$(EXE): pngtest.o $(STATLIB)
$(CC) -static $(CFLAGS) $< $(LDFLAGS) -o $@
pngtest.pic.o: pngtest.c
$(CC) $(CFLAGS) -c $< -o $@
pngtest.o: pngtest.c
$(CC) $(CFLAGS) -DPNG_STATIC -DZLIB_STATIC -c $< -o $@
2000-11-10 13:26:19 -05:00
test: test-static test-shared
2000-07-14 09:15:12 -04:00
2000-11-10 13:26:19 -05:00
test-static: pngtest-stat$(EXE)
2000-07-14 09:15:12 -04:00
./pngtest-stat
2000-11-10 13:26:19 -05:00
test-shared: pngtest$(EXE)
2000-07-14 09:15:12 -04:00
./pngtest
2000-11-10 13:26:19 -05:00
install: install-static install-shared
2000-11-23 12:51:42 -05:00
install-static: $(STATLIB) install-headers install-docs install-man
2000-11-10 13:26:19 -05:00
-@if [ ! -d $(LIBPATH) ]; then mkdir -p $(LIBPATH); fi
install -m 755 $(STATLIB) $(LIBPATH)
install-shared: $(SHAREDLIB) install-headers install-docs install-man
2000-07-14 09:15:12 -04:00
-@if [ ! -d $(LIBPATH) ]; then mkdir -p $(LIBPATH); fi
-@if [ ! -d $(BINPATH) ]; then mkdir -p $(BINPATH); fi
2000-11-10 13:26:19 -05:00
install -m 755 $(IMPLIB) $(LIBPATH)
2000-07-14 09:15:12 -04:00
install -s -m 755 $(SHAREDLIB) $(BINPATH)
2000-11-10 13:26:19 -05:00
install-headers:
2002-04-07 17:35:38 -04:00
-@if [ ! -d $(INCPATH)]; then mkdir -p $(INCPATH); fi
-@if [ ! -d $(INCPATH)/libpng ]; then mkdir -p $(INCPATH)/libpng; fi
-@rm -f ${INCPATH)/png.h
-@rm -f ${INCPATH)/pngconf.h
2000-11-10 13:26:19 -05:00
install -m 644 png.h pngconf.h $(INCPATH)
install-docs:
-@if [ ! -d $(DOCPATH) ]; then mkdir -p $(DOCPATH); fi
2000-07-14 09:15:12 -04:00
install -m 644 $(DOCS) $(DOCPATH)
2000-11-10 13:26:19 -05:00
install-man:
-@if [ ! -d $(MAN3PATH) ]; then mkdir -p $(MAN3PATH); fi
2000-07-14 09:15:12 -04:00
install -m 644 libpngpf.3 libpng.3 $(MAN3PATH)
clean:
/bin/rm -f *.pic.o *.o $(STATLIB) $(IMPLIB) $(SHAREDLIB) \
pngtest-stat$(EXE) pngtest$(EXE) pngout.png $(SHAREDDEF)
DOCS = ANNOUNCE CHANGES INSTALL KNOWNBUG LICENSE README TODO Y2KINFO
writelock:
chmod a-w *.[ch35] $(DOCS) scripts/*
# DO NOT DELETE THIS LINE -- make depend depends on it.
2001-01-12 16:13:06 -05:00
png.o png.pic.o: png.h pngconf.h png.c
2000-07-14 09:15:12 -04:00
pngerror.o pngerror.pic.o: png.h pngconf.h pngerror.c
pngrio.o pngrio.pic.o: png.h pngconf.h pngrio.c
pngwio.o pngwio.pic.o: png.h pngconf.h pngwio.c
pngmem.o pngmem.pic.o: png.h pngconf.h pngmem.c
pngset.o pngset.pic.o: png.h pngconf.h pngset.c
pngget.o pngget.pic.o: png.h pngconf.h pngget.c
pngread.o pngread.pic.o: png.h pngconf.h pngread.c
pngrtran.o pngrtran.pic.o: png.h pngconf.h pngrtran.c
2001-01-12 16:13:06 -05:00
pngrutil.o pngrutil.pic.o: png.h pngconf.h pngrutil.c
2000-07-14 09:15:12 -04:00
pngtrans.o pngtrans.pic.o: png.h pngconf.h pngtrans.c
pngwrite.o pngwrite.pic.o: png.h pngconf.h pngwrite.c
pngwtran.o pngwtran.pic.o: png.h pngconf.h pngwtran.c
pngwutil.o pngwutil.pic.o: png.h pngconf.h pngwutil.c
pngpread.o pngpread.pic.o: png.h pngconf.h pngpread.c
pngtest.o: png.h pngconf.h pngtest.c
pngtest-stat.o: png.h pngconf.h pngtest.c