2011-03-02 00:41:20 +03:00
|
|
|
|
|
|
|
LIBRARY= libpng
|
|
|
|
|
|
|
|
CC=gcc
|
|
|
|
CPP=gcc -E
|
|
|
|
AR= ar rc
|
|
|
|
|
|
|
|
CFLAGS = -c -O2 -fomit-frame-pointer
|
|
|
|
|
2011-03-12 12:36:46 +03:00
|
|
|
LDIMPORT:= -nostdlib --out-implib libpngimp.a
|
2011-03-04 08:55:41 +03:00
|
|
|
|
2011-03-12 12:36:46 +03:00
|
|
|
LDFLAGS:= -shared -s -T../newlib/dll.lds --image-base 0
|
2011-03-04 08:55:41 +03:00
|
|
|
|
2011-03-12 12:36:46 +03:00
|
|
|
DEFS = -DHAVE_CONFIG_H
|
2011-03-02 00:41:20 +03:00
|
|
|
|
|
|
|
LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG
|
|
|
|
|
|
|
|
DEFINES= $(DEFS) $(LIBPNG_DEFINES)
|
|
|
|
|
|
|
|
INCLUDES= -I../newlib/include -I../zlib
|
|
|
|
|
2011-03-04 08:55:41 +03:00
|
|
|
LIBPATH:= -L../newlib -L../zlib
|
|
|
|
|
|
|
|
LIBS:= -lamz -lgcc -lzimp -lcimp
|
2011-03-02 00:41:20 +03: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 \
|
2011-03-04 08:55:41 +03:00
|
|
|
pngwtran.c pngwutil.c
|
2011-03-02 00:41:20 +03:00
|
|
|
|
|
|
|
|
|
|
|
OBJECTS = $(patsubst %.c, %.o, $(SOURCES))
|
|
|
|
|
|
|
|
|
|
|
|
# targets
|
|
|
|
|
|
|
|
|
2011-03-04 08:55:41 +03:00
|
|
|
all:$(LIBRARY).a $(LIBRARY).dll
|
2011-03-02 00:41:20 +03:00
|
|
|
|
|
|
|
|
|
|
|
$(LIBRARY).a: $(OBJECTS) Makefile
|
|
|
|
ar cvrs $(LIBRARY).a $(OBJECTS)
|
|
|
|
|
2011-03-04 08:55:41 +03:00
|
|
|
$(LIBRARY).dll: $(OBJECTS) Makefile
|
2011-03-12 12:36:46 +03:00
|
|
|
ld $(LDFLAGS) $(LDIMPORT) $(LIBPATH) -o $@ $(OBJECTS) $(LIBS) symbols.def
|
2011-03-02 00:41:20 +03:00
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
2011-03-12 12:36:46 +03:00
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
|
|
|
|
|
2011-03-02 00:41:20 +03:00
|
|
|
|
|
|
|
|