Subversion Repositories Kolibri OS

Rev

Rev 1907 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1907 Rev 3928
Line 1... Line 1...
1
LIBRARY= libpng
1
LIBRARY= libpng16
2
 
2
 
3
CC=gcc
3
CC=gcc
4
CPP=gcc -E
4
CFLAGS = -U_Win32 -U_WIN32 -U__MINGW32__ -c -O2 -fomit-frame-pointer
-
 
5
 
-
 
6
LD = ld
5
AR= ar rc
7
 
-
 
8
AR= ar
6
 
9
 
7
CFLAGS = -c -O2 -fomit-frame-pointer
10
STRIP = $(PREFIX)strip
8
 
11
 
9
LDIMPORT:= -nostdlib --out-implib libpngimp.a 
12
LDFLAGS:=  -shared -s -nostdlib -T ../newlib/dll.lds --entry _DllStartup --image-base=0 --out-implib libpng.dll.a
10
 
13
 
11
LDFLAGS:=  -shared -s -T../newlib/dll.lds --image-base 0
14
INCLUDES= -I. -I../newlib/include -I../zlib
12
 
15
 
13
DEFS = -DHAVE_CONFIG_H
16
LIBPATH:= -L../newlib -L../zlib
14
 
17
 
15
LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG 
18
LIBS:=  -ldll -lc.dll -lz.dll
16
 
19
 
17
DEFINES= $(DEFS) $(LIBPNG_DEFINES)
20
DEFS = -DHAVE_CONFIG_H
18
 
21
 
19
INCLUDES= -I../newlib/include -I../zlib
22
 
20
 
-
 
21
LIBPATH:= -L../newlib -L../zlib
23
LIBPNG_DEFINES = -DPNG_CONFIGURE_LIBPNG 
22
 
24
 
23
LIBS:=  -lamz -lgcc -lzimp -lcimp 
25
DEFINES= $(DEFS) $(LIBPNG_DEFINES)
24
 
26
 
-
 
27
 
-
 
28
 
25
SOURCES = png.c pngerror.c pngget.c pngmem.c pngpread.c	\
29
SOURCES = png.c pngerror.c pngget.c pngmem.c pngpread.c	\
26
	  pngread.c pngrio.c pngrtran.c pngrutil.c	\
30
	  pngread.c pngrio.c pngrtran.c pngrutil.c	\
27
	  pngset.c pngtrans.c pngwio.c pngwrite.c 	\
31
	  pngset.c pngtrans.c pngwio.c pngwrite.c 	\
28
	  pngwtran.c pngwutil.c
32
	  pngwtran.c pngwutil.c
29
 
33
 
30
 
34
 
31
OBJECTS =  $(patsubst %.c, %.o, $(SOURCES))
35
OBJECTS =  $(patsubst %.c, %.o, $(SOURCES))
32
 
36
 
33
 
37
 
34
# targets 
38
# targets 
35
 
39
 
36
 
40
 
37
all:$(LIBRARY).a $(LIBRARY).dll
41
all:$(LIBRARY).a $(LIBRARY).dll
38
 
42
 
39
 
43
 
40
$(LIBRARY).a: $(OBJECTS) Makefile
44
$(LIBRARY).a: $(OBJECTS) Makefile
41
	ar cvrs $(LIBRARY).a $(OBJECTS)
45
	ar cvrs $(LIBRARY).a $(OBJECTS)
42
 
46
 
43
$(LIBRARY).dll: $(OBJECTS) Makefile
47
$(LIBRARY).dll: libpng16.def $(OBJECTS) Makefile
44
	ld $(LDFLAGS) $(LDIMPORT) $(LIBPATH) -o $@ $(OBJECTS) $(LIBS) symbols.def 
48
	$(LD) $(LDFLAGS) $(LIBPATH) -o $@  libpng16.def $(OBJECTS) $(LIBS)
45
 
49
	$(STRIP) $@
-
 
50
	sed -f ../newlib/cmd1.sed libpng16.def > mem
-
 
51
	sed -f ../newlib/cmd2.sed mem >libpng.inc
-
 
52
 
46
%.o : %.c Makefile
53
%.o : %.c Makefile
47
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
54
	$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
48
 
55
 
49
clean: 
56
clean: 
50
	-rm -f *.o
57
	-rm -f *.o
51
 
58
 
52
clean:>
59
clean:>
53
60
54
61
55
62