2013-12-15 09:09:20 +01:00
|
|
|
LIBRARY= libpng16
|
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
CC = kos32-gcc
|
|
|
|
AR = kos32-ar
|
|
|
|
LD = kos32-ld
|
|
|
|
STRIP = kos32-strip
|
2013-12-15 09:09:20 +01:00
|
|
|
|
2016-09-22 18:14:35 +02:00
|
|
|
INSTALLDIR:= /home/autobuild/tools/win32/lib
|
|
|
|
|
2014-08-07 13:48:01 +02:00
|
|
|
CFLAGS = -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -c -O2 -fno-ident -fomit-frame-pointer
|
2013-12-15 09:09:20 +01:00
|
|
|
|
2016-09-22 18:14:35 +02:00
|
|
|
LDFLAGS= -shared -s -T dll.lds --entry _DllStartup --image-base=0
|
2014-04-21 19:06:44 +02:00
|
|
|
LDFLAGS+= --out-implib $(LIBRARY).dll.a
|
|
|
|
|
|
|
|
ARFLAGS:= crs
|
2013-12-15 09:09:20 +01:00
|
|
|
|
2014-05-21 22:47:51 +02:00
|
|
|
INCLUDES= -I. -I../newlib/libc/include -I../zlib
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
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
|
2014-04-21 19:06:44 +02:00
|
|
|
$(AR) $(ARFLAGS) $(LIBRARY).a $(OBJECTS)
|
2016-09-22 18:14:35 +02:00
|
|
|
mv -f $(LIBRARY).a $(INSTALLDIR)
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
$(LIBRARY).dll: libpng16.def $(OBJECTS) Makefile
|
2016-09-22 18:14:35 +02:00
|
|
|
$(LD) $(LDFLAGS) -o $@ libpng16.def $(OBJECTS) $(LIBS)
|
2013-12-15 09:09:20 +01:00
|
|
|
$(STRIP) $@
|
2014-04-21 19:06:44 +02:00
|
|
|
#sed -f ../newlib/cmd1.sed libpng16.def > mem
|
|
|
|
#sed -f ../newlib/cmd2.sed mem >libpng.inc
|
2013-12-15 09:09:20 +01:00
|
|
|
mv -f $@ ../../bin
|
2016-09-22 18:14:35 +02:00
|
|
|
mv -f $(LIBRARY).dll.a $(INSTALLDIR)
|
2013-12-15 09:09:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|