d61570d842b2a03c76ffcc7575ec413318336775
[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 mkdir,$(OBJ)))
101
102 $(SYMBOLS): | objdir
103 $(OBJECTS): | objdir
104 $(TARGET): $(SOURCES) $(RESOURCES) $(SYMBOLS) $(OBJECTS) | objdir
105         @$(call rm,$(OBJ)objects.lst)
106         @$(call touch,$(OBJ)objects.lst)
107         $(call addtolistfile,$(_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 ifdef WINDOWS_HOST
115         $(AR) rcs $(TARGET) @$(OBJ)objects.lst $(LIBS)
116 else
117         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
118 endif
119 endif
120 ifdef SHARED_LIBRARY_TARGET
121 ifdef LINUX_TARGET
122 ifdef LINUX_HOST
123         $(if $(basename $(VER)),ln -sf $(LP)$(MODULE)$(SO)$(VER) $(OBJ)$(LP)$(MODULE)$(SO)$(basename $(VER)),)
124         $(if $(VER),ln -sf $(LP)$(MODULE)$(SO)$(VER) $(OBJ)$(LP)$(MODULE)$(SO),)
125 endif
126 endif
127 endif
128
129 # SYMBOL RULES
130
131 # C OBJECT RULES
132
133 # OBJECT RULES
134
135 $(OBJ)png.o: ./png.c
136         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./png.c) -o $(call quote_path,$@)
137
138 $(OBJ)pngerror.o: ./pngerror.c
139         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngerror.c) -o $(call quote_path,$@)
140
141 $(OBJ)pngget.o: ./pngget.c
142         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngget.c) -o $(call quote_path,$@)
143
144 $(OBJ)pngmem.o: ./pngmem.c
145         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngmem.c) -o $(call quote_path,$@)
146
147 $(OBJ)pngpread.o: ./pngpread.c
148         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngpread.c) -o $(call quote_path,$@)
149
150 $(OBJ)pngread.o: ./pngread.c
151         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngread.c) -o $(call quote_path,$@)
152
153 $(OBJ)pngrio.o: ./pngrio.c
154         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngrio.c) -o $(call quote_path,$@)
155
156 $(OBJ)pngrtran.o: ./pngrtran.c
157         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngrtran.c) -o $(call quote_path,$@)
158
159 $(OBJ)pngrutil.o: ./pngrutil.c
160         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngrutil.c) -o $(call quote_path,$@)
161
162 $(OBJ)pngset.o: ./pngset.c
163         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngset.c) -o $(call quote_path,$@)
164
165 $(OBJ)pngtrans.o: ./pngtrans.c
166         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngtrans.c) -o $(call quote_path,$@)
167
168 $(OBJ)pngwio.o: ./pngwio.c
169         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwio.c) -o $(call quote_path,$@)
170
171 $(OBJ)pngwrite.o: ./pngwrite.c
172         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwrite.c) -o $(call quote_path,$@)
173
174 $(OBJ)pngwtran.o: ./pngwtran.c
175         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwtran.c) -o $(call quote_path,$@)
176
177 $(OBJ)pngwutil.o: ./pngwutil.c
178         $(CC) $(CFLAGS) $(PRJ_CFLAGS) -c $(call quote_path,./pngwutil.c) -o $(call quote_path,$@)
179
180 cleantarget: objdir
181         $(call rm,$(OBJ)objects.lst)
182         $(call rm,$(TARGET))
183 ifdef SHARED_LIBRARY_TARGET
184 ifdef LINUX_TARGET
185 ifdef LINUX_HOST
186         $(call rm,$(OBJ)$(LP)$(MODULE)$(SO)$(basename $(VER)))
187         $(call rm,$(OBJ)$(LP)$(MODULE)$(SO))
188 endif
189 endif
190 endif
191
192 clean: cleantarget
193         $(call rm,$(_OBJECTS))
194
195 realclean: cleantarget
196         $(call rmr,$(OBJ))
197
198 distclean:
199         $(_MAKE) -f $(_CF_DIR)Cleanfile distclean distclean_all_subdirs
200
201 Makefile: ;
202 $(_CF_DIR)crossplatform.mk: ;
203 $(_CF_DIR)default.cf: ;