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