Rev 4930 | Go to most recent revision | 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 | |
5022 | Serge | 8 | CFLAGS = -UWIN32 -UWindows -U_WINDOWS -U_WIN32 -U__WIN32__ -c -O2 -fno-ident -fomit-frame-pointer |
4349 | Serge | 9 | |
4866 | Serge | 10 | LDFLAGS= -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 |
11 | LDFLAGS+= --out-implib $(LIBRARY).dll.a |
||
12 | |||
13 | ARFLAGS:= crs |
||
4349 | Serge | 14 | |
4930 | Serge | 15 | INCLUDES= -I. -I../newlib/libc/include -I../zlib |
4349 | Serge | 16 | |
17 | LIBPATH:= -L../../lib |
||
18 | |||
19 | LIBS:= -ldll -lc.dll -lz.dll |
||
20 | |||
21 | DEFS = -DHAVE_CONFIG_H |
||
22 | |||
23 | LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG |
||
24 | |||
25 | DEFINES= $(DEFS) $(LIBPNG_DEFINES) |
||
26 | |||
4367 | Serge | 27 | ifeq ($(findstring ebox,$(MAKECMDGOALS)),ebox) |
28 | CFLAGS+=-march=pentium-mmx |
||
29 | endif |
||
4349 | Serge | 30 | |
31 | |||
32 | SOURCES = png.c pngerror.c pngget.c pngmem.c pngpread.c \ |
||
33 | pngread.c pngrio.c pngrtran.c pngrutil.c \ |
||
34 | pngset.c pngtrans.c pngwio.c pngwrite.c \ |
||
35 | pngwtran.c pngwutil.c |
||
36 | |||
37 | |||
38 | OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) |
||
39 | |||
40 | |||
41 | # targets |
||
42 | |||
43 | |||
44 | all:$(LIBRARY).a $(LIBRARY).dll |
||
45 | |||
4367 | Serge | 46 | ebox:$(LIBRARY).a $(LIBRARY).dll |
4349 | Serge | 47 | |
48 | $(LIBRARY).a: $(OBJECTS) Makefile |
||
4866 | Serge | 49 | $(AR) $(ARFLAGS) $(LIBRARY).a $(OBJECTS) |
4362 | Serge | 50 | mv -f $(LIBRARY).a ../../lib |
4349 | Serge | 51 | |
52 | $(LIBRARY).dll: libpng16.def $(OBJECTS) Makefile |
||
53 | $(LD) $(LDFLAGS) $(LIBPATH) -o $@ libpng16.def $(OBJECTS) $(LIBS) |
||
54 | $(STRIP) $@ |
||
4866 | Serge | 55 | #sed -f ../newlib/cmd1.sed libpng16.def > mem |
56 | #sed -f ../newlib/cmd2.sed mem >libpng.inc |
||
4349 | Serge | 57 | mv -f $@ ../../bin |
58 | mv -f $(LIBRARY).dll.a ../../lib |
||
59 | |||
60 | |||
61 | %.o : %.c Makefile |
||
62 | $(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $< |
||
63 | |||
64 | clean: |
||
65 | -rm -f *.o |
||
66 | |||
67 | |||
68 |