-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
Makefile
205 lines (153 loc) · 4 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
TARGET := libvitaGL
SOURCES := source source/utils
CFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c))
CPPFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.cpp))
OBJS := $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
SAMPLES := $(foreach dir,$(wildcard samples/*), $(dir).smp)
SAMPLES_CLR := $(foreach dir,$(wildcard samples/*), $(dir).smpc)
PREFIX = arm-vita-eabi
CC = $(PREFIX)-gcc
CXX = $(PREFIX)-g++
AR = $(PREFIX)-gcc-ar
CFLAGS = -g -Wl,-q -O3 -ffast-math -mtune=cortex-a9 -mfpu=neon -Wno-incompatible-pointer-types -Wno-stringop-overflow
ASFLAGS = $(CFLAGS)
ifeq ($(SOFTFP_ABI),1)
CFLAGS += -mfloat-abi=softfp -DHAVE_SOFTFP_ABI
endif
ifeq ($(NO_DEBUG),1)
CFLAGS += -DSKIP_ERROR_HANDLING
endif
ifeq ($(NO_DMAC),1)
CFLAGS += -DDISABLE_DMAC
endif
ifeq ($(NO_TEX_COMBINER),1)
CFLAGS += -DDISABLE_TEXTURE_COMBINER
endif
ifeq ($(HAVE_SHARK_LOG),1)
CFLAGS += -DHAVE_SHARK_LOG
endif
ifeq ($(HAVE_CUSTOM_HEAP),1)
CFLAGS += -DHAVE_CUSTOM_HEAP
endif
ifeq ($(HAVE_GLSL_SUPPORT),1)
CFLAGS += -DHAVE_GLSL_TRANSLATOR
endif
ifeq ($(HAVE_UNFLIPPED_FBOS),1)
CFLAGS += -DHAVE_UNFLIPPED_FBOS
endif
ifeq ($(BUFFERS_SPEEDHACK),1)
CFLAGS += -DBUFFERS_SPEEDHACK
endif
ifeq ($(DRAW_SPEEDHACK),1)
CFLAGS += -DDRAW_SPEEDHACK
endif
ifeq ($(MATH_SPEEDHACK),1)
CFLAGS += -DMATH_SPEEDHACK
endif
ifeq ($(PRIMITIVES_SPEEDHACK),1)
CFLAGS += -DPRIMITIVES_SPEEDHACK
endif
ifeq ($(TEXTURES_SPEEDHACK),1)
CFLAGS += -DTEXTURES_SPEEDHACK
endif
ifeq ($(SHADER_COMPILER_SPEEDHACK),1)
CFLAGS += -DSHADER_COMPILER_SPEEDHACK
endif
ifeq ($(SHARED_RENDERTARGETS),1)
CFLAGS += -DHAVE_SHARED_RENDERTARGETS
endif
ifeq ($(SHARED_RENDERTARGETS),2)
CFLAGS += -DHAVE_SHARED_RENDERTARGETS -DRECYCLE_RENDERTARGETS
endif
ifeq ($(UNPURE_TEXTURES),1)
CFLAGS += -DHAVE_UNPURE_TEXTURES
endif
ifeq ($(UNPURE_TEXFORMATS),1)
CFLAGS += -DHAVE_UNPURE_TEXFORMATS
endif
ifeq ($(PHYCONT_ON_DEMAND),1)
CFLAGS += -DPHYCONT_ON_DEMAND
endif
ifeq ($(SINGLE_THREADED_GC),1)
CFLAGS += -DHAVE_SINGLE_THREADED_GC
endif
ifeq ($(CIRCULAR_VERTEX_POOL),1)
CFLAGS += -DHAVE_CIRCULAR_VERTEX_POOL
endif
ifeq ($(LOG_ERRORS),1)
CFLAGS += -DLOG_ERRORS
endif
ifeq ($(LOG_ERRORS),2)
CFLAGS += -DLOG_ERRORS -DFILE_LOG
endif
ifeq ($(HAVE_WRAPPED_ALLOCATORS),1)
CFLAGS += -DHAVE_WRAPPED_ALLOCATORS
endif
ifeq ($(HAVE_DEBUGGER),1)
CFLAGS += -DHAVE_DEBUG_INTERFACE
endif
ifeq ($(HAVE_DEBUGGER),2)
CFLAGS += -DHAVE_DEVKIT -DHAVE_RAZOR -DHAVE_RAZOR_INTERFACE -DHAVE_DEBUG_INTERFACE -DHAVE_LIGHT_RAZOR
endif
ifeq ($(HAVE_RAZOR),1)
CFLAGS += -DHAVE_RAZOR
endif
ifeq ($(HAVE_RAZOR),2)
CFLAGS += -DHAVE_RAZOR -DHAVE_RAZOR_INTERFACE -DHAVE_DEBUG_INTERFACE
endif
ifeq ($(HAVE_DEVKIT),1)
CFLAGS += -DHAVE_DEVKIT -DHAVE_RAZOR
endif
ifeq ($(HAVE_DEVKIT),2)
CFLAGS += -DHAVE_DEVKIT -DHAVE_RAZOR -DHAVE_RAZOR_INTERFACE -DHAVE_DEBUG_INTERFACE
endif
ifeq ($(SAMPLERS_SPEEDHACK),1)
CFLAGS += -DSAMPLERS_SPEEDHACK
endif
ifeq ($(HAVE_HIGH_FFP_TEXUNITS),1)
CFLAGS += -DHAVE_HIGH_FFP_TEXUNITS
endif
ifeq ($(HAVE_DISPLAY_LISTS),1)
CFLAGS += -DHAVE_DLISTS
endif
ifeq ($(HAVE_PTHREAD),1)
CFLAGS += -DHAVE_PTHREAD
endif
ifeq ($(SAFE_ETC1),1)
CFLAGS += -DDISABLE_HW_ETC1
endif
ifeq ($(SAFE_DRAW),1)
CFLAGS += -DSTRICT_DRAW_COMPLIANCE
endif
ifeq ($(HAVE_WVP_ON_GPU),1)
CFLAGS += -DHAVE_WVP_ON_GPU
endif
ifeq ($(STORE_DEPTH_STENCIL),1)
CFLAGS += -DSTORE_DEPTH_STENCIL
endif
ifeq ($(HAVE_VITA3K_SUPPORT),1)
CFLAGS += -DHAVE_VITA3K_SUPPORT -DDISABLE_HW_ETC1
endif
ifeq ($(HAVE_SHADER_CACHE),1)
CFLAGS += -DHAVE_SHADER_CACHE
endif
ifeq ($(HAVE_TEXTURE_CACHE),1)
CFLAGS += -DHAVE_TEX_CACHE
endif
CXXFLAGS = $(CFLAGS) -fno-exceptions -std=gnu++11 -Wno-write-strings
all: $(TARGET).a
$(TARGET).a: $(OBJS)
$(AR) -rc $@ $^
%.smpc:
@make -C $(@:.smpc=) clean
%.smp:
@make -C $(@:.smp=)
ls -1 $(@:.smp=)/*.vpk | xargs -L1 -I{} cp {} .
clean: $(SAMPLES_CLR)
@rm -rf $(TARGET).a $(TARGET).elf $(OBJS)
install: $(TARGET).a
@mkdir -p $(VITASDK)/$(PREFIX)/lib/
cp $(TARGET).a $(VITASDK)/$(PREFIX)/lib/
@mkdir -p $(VITASDK)/$(PREFIX)/include/
cp source/vitaGL.h $(VITASDK)/$(PREFIX)/include/
samples: $(SAMPLES)