de40b3fb25f1fad10469aecbce0ffebfb03192cf
[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 # TOOLCHAIN
37
38 CPP := cpp
39 CC := gcc
40 LD := gcc
41 AR := ar
42 STRIP := strip
43 UPX := upx
44
45 # FLAGS
46
47 CFLAGS = -fmessage-length=0 -O2 -ffast-math -m32 $(FPIC) -w \
48          -I. \
49          -I../zlib
50
51 LIBS = $(SHAREDLIB) $(EXECUTABLE) $(LINKOPT)
52
53 UPXFLAGS = -9 -q
54
55 # HARD CODED PLATFORM-SPECIFIC OPTIONS
56 ifdef LINUX
57 OFLAGS += -Wl,--no-undefined
58 endif
59
60 # TARGETS
61
62 all: objdir $(TARGET)
63
64 objdir:
65         $(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))
66
67 $(TARGET): $(SOURCES) $(RESOURCES) | objdir $(SYMBOLS) $(OBJECTS)
68         $(AR) rcs $(TARGET) $(OBJECTS) $(LIBS)
69
70 # SYMBOL RULES
71
72 # C OBJECT RULES
73
74 # OBJECT RULES
75
76 $(OBJ)png.o: ./png.c
77         $(CC) $(CFLAGS) -c ./png.c -o $(OBJ)png.o
78
79 $(OBJ)pngerror.o: ./pngerror.c
80         $(CC) $(CFLAGS) -c ./pngerror.c -o $(OBJ)pngerror.o
81
82 $(OBJ)pngget.o: ./pngget.c
83         $(CC) $(CFLAGS) -c ./pngget.c -o $(OBJ)pngget.o
84
85 $(OBJ)pngmem.o: ./pngmem.c
86         $(CC) $(CFLAGS) -c ./pngmem.c -o $(OBJ)pngmem.o
87
88 $(OBJ)pngpread.o: ./pngpread.c
89         $(CC) $(CFLAGS) -c ./pngpread.c -o $(OBJ)pngpread.o
90
91 $(OBJ)pngread.o: ./pngread.c
92         $(CC) $(CFLAGS) -c ./pngread.c -o $(OBJ)pngread.o
93
94 $(OBJ)pngrio.o: ./pngrio.c
95         $(CC) $(CFLAGS) -c ./pngrio.c -o $(OBJ)pngrio.o
96
97 $(OBJ)pngrtran.o: ./pngrtran.c
98         $(CC) $(CFLAGS) -c ./pngrtran.c -o $(OBJ)pngrtran.o
99
100 $(OBJ)pngrutil.o: ./pngrutil.c
101         $(CC) $(CFLAGS) -c ./pngrutil.c -o $(OBJ)pngrutil.o
102
103 $(OBJ)pngset.o: ./pngset.c
104         $(CC) $(CFLAGS) -c ./pngset.c -o $(OBJ)pngset.o
105
106 $(OBJ)pngtrans.o: ./pngtrans.c
107         $(CC) $(CFLAGS) -c ./pngtrans.c -o $(OBJ)pngtrans.o
108
109 $(OBJ)pngwio.o: ./pngwio.c
110         $(CC) $(CFLAGS) -c ./pngwio.c -o $(OBJ)pngwio.o
111
112 $(OBJ)pngwrite.o: ./pngwrite.c
113         $(CC) $(CFLAGS) -c ./pngwrite.c -o $(OBJ)pngwrite.o
114
115 $(OBJ)pngwtran.o: ./pngwtran.c
116         $(CC) $(CFLAGS) -c ./pngwtran.c -o $(OBJ)pngwtran.o
117
118 $(OBJ)pngwutil.o: ./pngwutil.c
119         $(CC) $(CFLAGS) -c ./pngwutil.c -o $(OBJ)pngwutil.o
120
121 clean: objdir
122         $(call rmq,$(TARGET))
123         $(call rmq,$(OBJECTS))
124         $(call rmq,$(COBJECTS))
125
126 realclean:
127         $(call rmrq,$(OBJ))
128
129 distclean:
130         $(call rmrq,obj/)