kolibrios-gitea/programs/develop/libraries/libpng/Makefile
Sergey Semyonov (Serge) 9f45ae510b libpng-1.6.5
git-svn-id: svn://kolibrios.org@3928 a494cfbc-eb01-0410-851d-a64ba20cac60
2013-09-21 21:02:01 +00:00

63 lines
1.2 KiB
Makefile

LIBRARY= libpng16
CC=gcc
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -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 libpng.dll.a
INCLUDES= -I. -I../newlib/include -I../zlib
LIBPATH:= -L../newlib -L../zlib
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)
$(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
%.o : %.c Makefile
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
clean:
-rm -f *.o