deps: zlib-1.2.3 -> 1.2.8; libpng-1.4.0 -> 1.6.12
[sdk] / deps / libpng-1.6.12 / Makefile
1 .PHONY: all objdir cleantarget clean realclean distclean
2
3 # CORE VARIABLES
4
5 MODULE := libpng
6 VERSION := 
7 CONFIG := release
8 ifndef COMPILER
9 COMPILER := default
10 endif
11
12 TARGET_TYPE = staticlib
13
14 # FLAGS
15
16 ECFLAGS =
17 ifndef DEBIAN_PACKAGE
18 CFLAGS =
19 LDFLAGS =
20 endif
21 PRJ_CFLAGS =
22 CECFLAGS =
23 OFLAGS =
24 LIBS =
25
26 ifdef DEBUG
27 NOSTRIP := y
28 endif
29
30 CONSOLE = -mwindows
31
32 # INCLUDES
33
34 _CF_DIR = ../../
35
36 include $(_CF_DIR)crossplatform.mk
37 include $(_CF_DIR)default.cf
38
39 # POST-INCLUDES VARIABLES
40
41 OBJ = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/
42
43 RES = 
44
45 TARGET = obj/$(CONFIG).$(PLATFORM)$(COMPILER_SUFFIX)$(DEBUG_SUFFIX)/$(LP)png$(A)
46
47 _OBJECTS = \
48         $(OBJ)png.o \
49         $(OBJ)pngerror.o \
50         $(OBJ)pngget.o \
51         $(OBJ)pngmem.o \
52         $(OBJ)pngpread.o \
53         $(OBJ)pngread.o \
54         $(OBJ)pngrio.o \
55         $(OBJ)pngrtran.o \
56         $(OBJ)pngrutil.o \
57         $(OBJ)pngset.o \
58         $(OBJ)pngtrans.o \
59         $(OBJ)pngwio.o \
60         $(OBJ)pngwrite.o \
61         $(OBJ)pngwtran.o \
62         $(OBJ)pngwutil.o
63
64 OBJECTS = $(_OBJECTS)
65
66 SOURCES = \
67         ./png.c \
68         ./pngerror.c \
69         ./pngget.c \
70         ./pngmem.c \
71         ./pngpread.c \
72         ./pngread.c \
73         ./pngrio.c \
74         ./pngrtran.c \
75         ./pngrutil.c \
76         ./pngset.c \
77         ./pngtrans.c \
78         ./pngwio.c \
79         ./pngwrite.c \
80         ./pngwtran.c \
81         ./pngwutil.c
82
83 RESOURCES =
84
85 LIBS += $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
86
87 PRJ_CFLAGS += \
88          $(if $(DEBUG), -g, -O2 -ffast-math) $(FPIC) -w -DREPOSITORY_VERSION="\"$(REPOSITORY_VER)\"" \
89                          -I. \
90                          -I../zlib-1.2.8
91
92 ECFLAGS += -module $(MODULE)
93 CECFLAGS += -cpp $(_CPP)
94
95 # TARGETS
96
97 all: objdir $(TARGET)
98
99 objdir:
100         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
101
102 $(SYMBOLS): | objdir
103 $(OBJECTS): | objdir
104 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
105         @$(call rmq,$(OBJ)objects.lst)
106         @$(call touch,$(OBJ)objects.lst)
107         @$(call echo,$(_OBJECTS)) >> $(OBJ)objects.lst
108 ifndef STATIC_LIBRARY_TARGET
109         $(CC) $(OFLAGS) @$(OBJ)objects.lst $(LIBS) -o $(TARGET) $(INSTALLNAME)
110 ifndef NOSTRIP
111         $(STRIP) $(STRIPOPT) $(TARGET)
112 endif
113 else
114         $(AR) rcs $(TARGET) @$(OBJ)objects.lst $(LIBS)
115 endif
116 ifdef SHARED_LIBRARY_TARGET
117 ifdef LINUX_TARGET
118 ifdef LINUX_HOST
119         $(if $(basename $(VER)),ln -sf $(LP)$(MODULE)$(SO)$(VER) $(OBJ)$(LP)$(MODULE)$(SO)$(basename $(VER)),)
120         $(if $(VER),ln -sf $(LP)$(MODULE)$(SO)$(VER) $(OBJ)$(LP)$(MODULE)$(SO),)
121 endif
122 endif
123 endif
124
125 # SYMBOL RULES
126
127 # C OBJECT RULES
128
129 # OBJECT RULES
130
131 $(OBJ)png.o: ./png.c
132         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./png.c) -o $(call quote_path,$@)
133
134 $(OBJ)pngerror.o: ./pngerror.c
135         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngerror.c) -o $(call quote_path,$@)
136
137 $(OBJ)pngget.o: ./pngget.c
138         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngget.c) -o $(call quote_path,$@)
139
140 $(OBJ)pngmem.o: ./pngmem.c
141         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngmem.c) -o $(call quote_path,$@)
142
143 $(OBJ)pngpread.o: ./pngpread.c
144         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngpread.c) -o $(call quote_path,$@)
145
146 $(OBJ)pngread.o: ./pngread.c
147         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngread.c) -o $(call quote_path,$@)
148
149 $(OBJ)pngrio.o: ./pngrio.c
150         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngrio.c) -o $(call quote_path,$@)
151
152 $(OBJ)pngrtran.o: ./pngrtran.c
153         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngrtran.c) -o $(call quote_path,$@)
154
155 $(OBJ)pngrutil.o: ./pngrutil.c
156         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngrutil.c) -o $(call quote_path,$@)
157
158 $(OBJ)pngset.o: ./pngset.c
159         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngset.c) -o $(call quote_path,$@)
160
161 $(OBJ)pngtrans.o: ./pngtrans.c
162         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngtrans.c) -o $(call quote_path,$@)
163
164 $(OBJ)pngwio.o: ./pngwio.c
165         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwio.c) -o $(call quote_path,$@)
166
167 $(OBJ)pngwrite.o: ./pngwrite.c
168         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwrite.c) -o $(call quote_path,$@)
169
170 $(OBJ)pngwtran.o: ./pngwtran.c
171         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwtran.c) -o $(call quote_path,$@)
172
173 $(OBJ)pngwutil.o: ./pngwutil.c
174         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwutil.c) -o $(call quote_path,$@)
175
176 cleantarget: objdir
177         $(call rmq,$(OBJ)objects.lst)
178         $(call rmq,$(TARGET))
179 ifdef SHARED_LIBRARY_TARGET
180 ifdef LINUX_TARGET
181 ifdef LINUX_HOST
182         $(call rmq,$(OBJ)$(LP)$(MODULE)$(SO)$(basename $(VER)))
183         $(call rmq,$(OBJ)$(LP)$(MODULE)$(SO))
184 endif
185 endif
186 endif
187
188 clean: cleantarget
189         $(call rmq,$(_OBJECTS))
190
191 realclean: cleantarget
192         $(call rmrq,$(OBJ))
193
194 distclean: cleantarget
195         $(call rmrq,obj/)