2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
LIBRARY= libpng16
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer
|
|
|
|
|
|
|
|
LD = ld
|
|
|
|
|
|
|
|
AR= ar
|
|
|
|
|
|
|
|
STRIP = $(PREFIX)strip
|
|
|
|
|
|
|
|
LDFLAGS:= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 --out-implib $(LIBRARY).dll.a
|
|
|
|
|
|
|
|
INCLUDES= -I. -I../newlib/include -I../zlib
|
|
|
|
|
|
|
|
LIBPATH:= -L../../lib
|
|
|
|
|
|
|
|
LIBS:= -ldll -lc.dll -lz.dll
|
|
|
|
|
|
|
|
DEFS = -DHAVE_CONFIG_H
|
|
|
|
|
|
|
|
LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG
|
|
|
|
|
|
|
|
DEFINES= $(DEFS) $(LIBPNG_DEFINES)
|
|
|
|
|
2013-12-16 01:16:20 +01:00
|
|
|
ifeq ($(findstring ebox,$(MAKECMDGOALS)),ebox)
|
|
|
|
CFLAGS+=-march=pentium-mmx
|
|
|
|
endif
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
SOURCES = png.c pngerror.c pngget.c pngmem.c pngpread.c \
|
|
|
|
pngread.c pngrio.c pngrtran.c pngrutil.c \
|
|
|
|
pngset.c pngtrans.c pngwio.c pngwrite.c \
|
|
|
|
pngwtran.c pngwutil.c
|
|
|
|
|
|
|
|
|
|
|
|
OBJECTS = $(patsubst %.c, %.o, $(SOURCES))
|
|
|
|
|
|
|
|
|
|
|
|
# targets
|
|
|
|
|
|
|
|
|
|
|
|
all:$(LIBRARY).a $(LIBRARY).dll
|
|
|
|
|
2013-12-16 01:16:20 +01:00
|
|
|
ebox:$(LIBRARY).a $(LIBRARY).dll
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
$(LIBRARY).a: $(OBJECTS) Makefile
|
|
|
|
ar cvrs $(LIBRARY).a $(OBJECTS)
|
2013-12-15 14:22:19 +01:00
|
|
|
mv -f $(LIBRARY).a ../../lib
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
$(LIBRARY).dll: libpng16.def $(OBJECTS) Makefile
|
|
|
|
$(LD) $(LDFLAGS) $(LIBPATH) -o $@ libpng16.def $(OBJECTS) $(LIBS)
|
|
|
|
$(STRIP) $@
|
|
|
|
sed -f ../newlib/cmd1.sed libpng16.def > mem
|
|
|
|
sed -f ../newlib/cmd2.sed mem >libpng.inc
|
|
|
|
mv -f $@ ../../bin
|
|
|
|
mv -f $(LIBRARY).dll.a ../../lib
|
|
|
|
|
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|