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
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
CFLAGS = -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -c -O2 -fomit-frame-pointer
|
2013-12-15 09:09:20 +01:00
|
|
|
|
2014-04-21 19:06:44 +02:00
|
|
|
LDFLAGS= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0
|
|
|
|
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
|
|
|
|
|
|
|
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
|
2014-04-21 19:06:44 +02:00
|
|
|
$(AR) $(ARFLAGS) $(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) $@
|
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
|
|
|
|
mv -f $(LIBRARY).dll.a ../../lib
|
|
|
|
|
|
|
|
|
|
|
|
%.o : %.c Makefile
|
|
|
|
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
|
|
|
|
|
|
|
|
clean:
|
|
|
|
-rm -f *.o
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|