-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile.xenon
60 lines (49 loc) · 1.43 KB
/
Makefile.xenon
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
# Makefile to build the SDL library
INCLUDE = -I./include -I./src/video -I./src/audio -I./src/joystick
CFLAGS = -g -O2 $(INCLUDE)
CC = xenon-gcc
AR = xenon-ar
AS = xenon-as
RANLIB = xenon-ranlib
CFLAGS=$(INCLUDE) -ffunction-sections -fdata-sections -mno-altivec -mhard-float -mcpu=cell -mtune=cell -m32 -fno-pic -mpowerpc64 -I$(DEVKITXENON)/usr/include/
CONFIG_H = include/SDL_config.h
TARGET = libSDL.a
SOURCES = \
src/*.c \
src/audio/*.c \
src/cdrom/*.c \
src/cpuinfo/*.c \
src/events/*.c \
src/file/*.c \
src/joystick/*.c \
src/stdlib/*.c \
src/thread/*.c \
src/timer/*.c \
src/timer/xenon/*.c \
src/video/*.c \
src/audio/xenon/*.c \
src/video/xenon/*.c \
src/video/xenon/*.s \
src/joystick/xenon/*.c \
src/cdrom/dummy/*.c \
src/thread/xenon/*.c \
src/loadso/dummy/*.c \
OBJECTS = $(shell echo $(SOURCES) | sed -e 's,\.c,\.o,g' -e 's,\.s,\.o,g')
all: $(TARGET)
$(TARGET): $(CONFIG_H) $(OBJECTS)
$(AR) crv $@ $^
%.o: %.c
@echo [$(notdir $<)]
@$(CC) -o $@ -c $< $(CFLAGS)
%.o: %.s
@echo [$(notdir $<) $@ $*]
$(CC) -MMD -MP -MF $*.d -x assembler-with-cpp $(ASFLAGS) -DXENON -m32 -mno-altivec -fno-pic -mpowerpc64 -mhard-float -c $< -o $@
$(CONFIG_H):
cp include/SDL_config_xenon.h $(CONFIG_H)
clean:
rm -f $(TARGET) $(OBJECTS)
install: all
rm -f $(DEVKITXENON)/usr/include/SDL/ -R
mkdir $(DEVKITXENON)/usr/include/SDL/
cp -r include/* $(DEVKITXENON)/usr/include/SDL/
cp $(TARGET) $(DEVKITXENON)/usr/lib/$(TARGET)