kolibrios/contrib/sdk/sources/libpng/Makefile.ebox
Sergey Semyonov (Serge) 0e7748e8a2 sdk: update
git-svn-id: svn://kolibrios.org@4362 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-12-15 13:22:19 +00:00

67 lines
1.3 KiB
Makefile

LIBRARY= libpng16
CC=gcc
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -march=pentium-mmx -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../zlib -L ../../static -L ../../import
LIBS:= -ldll -lc.dll -lz.dll
DEFS = -DHAVE_CONFIG_H
LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG
DEFINES= $(DEFS) $(LIBPNG_DEFINES)
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
$(LIBRARY).a: $(OBJECTS) Makefile
ar cvrs $(LIBRARY).a $(OBJECTS)
mv -f $(LIBRARY).a ../../lib
$(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