-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_4.41
65 lines (50 loc) · 2.06 KB
/
Makefile_4.41
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
MAMBA_VER = 4_41
ifeq ($(OS),Windows_NT)
ZLIBUTIL = ./zlibutil.exe
endif
ifeq ($(shell uname -s),Linux)
ZLIBUTIL = ./zlibutil
endif
CC := ppu-gcc
CXX := ppu-g++
LD := ppu-ld
OBJCOPY := ppu-objcopy
OBJDUMP := ppu-objdump
AR := ppu-ar
STRIP := ppu-strip
INCLUDE = $(PS3DEV)/ppu/ppu/include lv2/include lv1/include debug/include
LIBSDIR =
LIBS =
BUILD_TYPE = release
CFLAGS = -ffunction-sections -fdata-sections -O2 -m64 -fno-builtin -fno-exceptions \
-Wall -Wno-strict-aliasing -Wno-multichar $(foreach dir,$(INCLUDE),-I$(dir)) \
-DLV2 -DUSE_LV1_PEEK_POKE -DFIRMWARE_$(MAMBA_VER) -DPS3M_API -DKW_STEALTH_EXT -DIS_MAMBA -ffreestanding
CFLAGS += --std=gnu99
ifeq ($(BUILD_TYPE), debug)
CFLAGS += -DDEBUG -DTEST
endif
LDFLAGS= -T stage2/stage2.ld -nostartfiles -nostdlib -nodefaultlibs -Wl,-static -L. $(foreach dir,$(LIBSDIR),-L$(dir)) $(LIBS) \
-Wl,--gc-sections -Wl,-Map=stage2/stage2.map
OBJS = stage2/start.o stage2/main.o stage2/ps3mapi_core.o stage2/mappath.o stage2/storage_ext.o stage2/crypto.o stage2/modulespatch.o stage2/config.o stage2/region.o \
lv2/src/patch.o lv2/src/interrupt.o lv2/src/interrupt_c.o lv2/src/io.o lv2/src/libc.o \
lv2/src/libc_c.o lv2/src/memory.o lv2/src/memory_c.o lv2/src/thread.o lv2/src/thread_c.o lv2/src/process.o \
lv2/src/synchronization.o lv2/src/modules.o lv2/src/modules_c.o lv2/src/storage.o lv2/src/object.o \
lv2/src/security.o lv2/src/time.o lv2/src/syscall.o \
lv1/src/hvcall.o lv1/src/stor.o lv1/src/device.o
ifeq ($(BUILD_TYPE), debug)
OBJS += debug/src/debug.o debug/src/debug_util.o debug/src/printf.o
endif
all: mamba_$(MAMBA_VER).bin
objdump: stage$(MAMBA_VER).bin
$(OBJDUMP) -D -EB -b binary -m powerpc:common64 mamba_$(MAMBA_VER).bin
%.bin: %.elf
$(OBJCOPY) -O binary $< $@
$(ZLIBUTIL) mamba_$(MAMBA_VER).bin mamba_$(MAMBA_VER).lz.bin
mamba_$(MAMBA_VER).elf: $(OBJS) stage2/stage2.ld
$(CC) $(LDFLAGS) -o $@ $(OBJS)
%.o: %.S
$(CC) $(CFLAGS) -c -o $@ $<
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *.o *.elf stage2/*.map stage2/*.o lv2/src/*.o lv1/src/*.o debug/src/*.o