Rev 6531 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4349 | Serge | 1 | LIBRARY= libpng16 |
2 | |||
4866 | Serge | 3 | CC = kos32-gcc |
4 | AR = kos32-ar |
||
5 | LD = kos32-ld |
||
6 | STRIP = kos32-strip |
||
4349 | Serge | 7 | |
6981 | ashmew2 | 8 | INSTALLDIR ?= /home/autobuild/tools/win32/lib |
6531 | serge | 9 | |
5022 | Serge | 10 | CFLAGS = -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -c -O2 -fno-ident -fomit-frame-pointer |
4349 | Serge | 11 | |
6981 | ashmew2 | 12 | LDFLAGS=$(LDFLAGS_CMD) |
13 | LDFLAGS+= -shared -s -T dll.lds --entry _DllStartup --image-base=0 |
||
4866 | Serge | 14 | LDFLAGS+= --out-implib $(LIBRARY).dll.a |
15 | |||
16 | ARFLAGS:= crs |
||
4349 | Serge | 17 | |
4930 | Serge | 18 | INCLUDES= -I. -I../newlib/libc/include -I../zlib |
4349 | Serge | 19 | |
20 | LIBS:= -ldll -lc.dll -lz.dll |
||
21 | |||
22 | DEFS = -DHAVE_CONFIG_H |
||
23 | |||
24 | LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG |
||
25 | |||
26 | DEFINES= $(DEFS) $(LIBPNG_DEFINES) |
||
27 | |||
4367 | Serge | 28 | ifeq ($(findstring ebox,$(MAKECMDGOALS)),ebox) |
29 | CFLAGS+=-march=pentium-mmx |
||
30 | endif |
||
4349 | Serge | 31 | |
32 | |||
33 | SOURCES = png.c pngerror.c pngget.c pngmem.c pngpread.c \ |
||
34 | pngread.c pngrio.c pngrtran.c pngrutil.c \ |
||
35 | pngset.c pngtrans.c pngwio.c pngwrite.c \ |
||
36 | pngwtran.c pngwutil.c |
||
37 | |||
38 | |||
39 | OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) |
||
40 | |||
41 | |||
42 | # targets |
||
43 | |||
44 | |||
45 | all:$(LIBRARY).a $(LIBRARY).dll |
||
46 | |||
4367 | Serge | 47 | ebox:$(LIBRARY).a $(LIBRARY).dll |
4349 | Serge | 48 | |
49 | $(LIBRARY).a: $(OBJECTS) Makefile |
||
4866 | Serge | 50 | $(AR) $(ARFLAGS) $(LIBRARY).a $(OBJECTS) |
6531 | serge | 51 | mv -f $(LIBRARY).a $(INSTALLDIR) |
4349 | Serge | 52 | |
53 | $(LIBRARY).dll: libpng16.def $(OBJECTS) Makefile |
||
6531 | serge | 54 | $(LD) $(LDFLAGS) -o $@ libpng16.def $(OBJECTS) $(LIBS) |
4349 | Serge | 55 | $(STRIP) $@ |
4866 | Serge | 56 | #sed -f ../newlib/cmd1.sed libpng16.def > mem |
57 | #sed -f ../newlib/cmd2.sed mem >libpng.inc |
||
4349 | Serge | 58 | mv -f $@ ../../bin |
6531 | serge | 59 | mv -f $(LIBRARY).dll.a $(INSTALLDIR) |
4349 | Serge | 60 | |
61 | |||
62 | %.o : %.c Makefile |
||
63 | $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $< |
||
64 | |||
65 | clean: |
||
66 | -rm -f *.o |
||
67 | |||
68 | |||
69 |