build system / makefiles / ide: added support for ccache and distcc
[sdk] / deps / libpng-1.4.0 / Makefile
1 .PHONY: all objdir clean realclean distclean
2
3 # CONTENT
4
5 MODULE := libpng
6 CONFIG := release
7 COMPILER := default
8 TARGET_TYPE = staticlib
9
10 OBJ = obj/$(CONFIG).$(PLATFORM)/
11
12 RES = 
13
14 TARGET = obj/$(CONFIG).$(PLATFORM)/$(LP)png$(A)
15
16 OBJECTS = $(OBJ)png.o $(OBJ)pngerror.o $(OBJ)pngget.o $(OBJ)pngmem.o $(OBJ)pngpread.o \
17         $(OBJ)pngread.o $(OBJ)pngrio.o $(OBJ)pngrtran.o $(OBJ)pngrutil.o $(OBJ)pngset.o \
18         $(OBJ)pngtrans.o $(OBJ)pngwio.o $(OBJ)pngwrite.o $(OBJ)pngwtran.o $(OBJ)pngwutil.o
19
20 COBJECTS =
21
22 SYMBOLS =
23
24 IMPORTS =
25
26 SOURCES = ./png.c ./pngerror.c ./pngget.c ./pngmem.c ./pngpread.c ./pngread.c ./pngrio.c \
27         ./pngrtran.c ./pngrutil.c ./pngset.c ./pngtrans.c ./pngwio.c ./pngwrite.c ./pngwtran.c \
28         ./pngwutil.c
29
30 RESOURCES =
31
32 # CROSS-PLATFORM MAGIC
33
34 include ../../include.mk
35
36 # FLAGS
37
38 CFLAGS = -fmessage-length=0 -O2 -ffast-math -m32 $(FPIC) -w \
39          -I. \
40          -I../zlib
41
42 LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
43
44 UPXFLAGS = -9 -q
45
46 # HARD CODED PLATFORM-SPECIFIC OPTIONS
47 ifdef LINUX
48 OFLAGS += -Wl,--no-undefined
49 endif
50
51 # TARGETS
52
53 all: objdir $(TARGET)
54
55 objdir:
56         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
57
58 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
59         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
60
61 # SYMBOL RULES
62
63 # C OBJECT RULES
64
65 # OBJECT RULES
66
67 $(OBJ)png.o: ./png.c
68         $(CC) $(CFLAGS) -c ./png.c -o $(OBJ)png.o
69
70 $(OBJ)pngerror.o: ./pngerror.c
71         $(CC) $(CFLAGS) -c ./pngerror.c -o $(OBJ)pngerror.o
72
73 $(OBJ)pngget.o: ./pngget.c
74         $(CC) $(CFLAGS) -c ./pngget.c -o $(OBJ)pngget.o
75
76 $(OBJ)pngmem.o: ./pngmem.c
77         $(CC) $(CFLAGS) -c ./pngmem.c -o $(OBJ)pngmem.o
78
79 $(OBJ)pngpread.o: ./pngpread.c
80         $(CC) $(CFLAGS) -c ./pngpread.c -o $(OBJ)pngpread.o
81
82 $(OBJ)pngread.o: ./pngread.c
83         $(CC) $(CFLAGS) -c ./pngread.c -o $(OBJ)pngread.o
84
85 $(OBJ)pngrio.o: ./pngrio.c
86         $(CC) $(CFLAGS) -c ./pngrio.c -o $(OBJ)pngrio.o
87
88 $(OBJ)pngrtran.o: ./pngrtran.c
89         $(CC) $(CFLAGS) -c ./pngrtran.c -o $(OBJ)pngrtran.o
90
91 $(OBJ)pngrutil.o: ./pngrutil.c
92         $(CC) $(CFLAGS) -c ./pngrutil.c -o $(OBJ)pngrutil.o
93
94 $(OBJ)pngset.o: ./pngset.c
95         $(CC) $(CFLAGS) -c ./pngset.c -o $(OBJ)pngset.o
96
97 $(OBJ)pngtrans.o: ./pngtrans.c
98         $(CC) $(CFLAGS) -c ./pngtrans.c -o $(OBJ)pngtrans.o
99
100 $(OBJ)pngwio.o: ./pngwio.c
101         $(CC) $(CFLAGS) -c ./pngwio.c -o $(OBJ)pngwio.o
102
103 $(OBJ)pngwrite.o: ./pngwrite.c
104         $(CC) $(CFLAGS) -c ./pngwrite.c -o $(OBJ)pngwrite.o
105
106 $(OBJ)pngwtran.o: ./pngwtran.c
107         $(CC) $(CFLAGS) -c ./pngwtran.c -o $(OBJ)pngwtran.o
108
109 $(OBJ)pngwutil.o: ./pngwutil.c
110         $(CC) $(CFLAGS) -c ./pngwutil.c -o $(OBJ)pngwutil.o
111
112 clean: objdir
113         $(call rmq,$(TARGET))
114         $(call rmq,$(OBJECTS))
115         $(call rmq,$(COBJECTS))
116
117 realclean:
118         $(call rmrq,$(OBJ))
119
120 distclean:
121         $(call rmrq,obj/)