Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added some make rules. Still need to find an alternative to newlib fo…

…r ppc64.
  • Loading branch information...
commit 6883bafca7fa1f74b3a855f547c2a6dc11ca27d7 1 parent 681dab0
@trap15 trap15 authored
Showing with 59 additions and 3 deletions.
  1. +14 −3 buildit.sh
  2. +24 −0 common.mk
  3. +9 −0 common_pre.mk
  4. +6 −0 ppu.mk
  5. +6 −0 spu.mk
View
17 buildit.sh
@@ -160,6 +160,13 @@ makedirs() {
mkdir -p $PS3DEV/build_newlib || die "Error making newlib build directory $PS3DEV/build_newlib"
}
+copy_makerules() {
+ TARGET=$1
+ cp common.mk $PS3DEV/
+ cp common_pre.mk $PS3DEV/
+ cp $TARGET.mk $PS3DEV/
+}
+
buildbinutils() {
TARGET=$1
FOLDER=$2
@@ -188,12 +195,14 @@ buildgcc() {
TARGET=$1
FOLDER=$2
NEWLIBFLAG=$3
+ CPUFLAG=$4
(
cd $PS3DEV/build_gcc && \
$PS3DEV/$GCC_DIR/configure --target=$TARGET --disable-multilib \
--prefix=$PS3DEV/$FOLDER \
--enable-languages="c,c++" \
- --enable-checking=release $NEWLIBFLAG $EXTRAFLAGS && \
+ --enable-checking=release $NEWLIBFLAG $EXTRAFLAGS \
+ $CPUFLAG && \
$MAKE all-gcc $MAKEOPTS && \
$MAKE install-gcc
) || die "Error building gcc for target $TARGET"
@@ -217,6 +226,7 @@ buildspu() {
extract_archives
cleanbuild
makedirs
+ copy_makerules spu
echo "******* Building SPU binutils"
buildbinutils $SPU_TARGET spu
echo "******* Building SPU GCC"
@@ -234,14 +244,15 @@ buildppu() {
extract_archives
cleanbuild
makedirs
+ copy_makerules ppu
echo "******* Building PPU binutils"
buildbinutils $PPU_TARGET ppu
echo "******* Building PPU GCC"
- EXTRAFLAGS=--with-cpu=cell buildgcc $PPU_TARGET ppu
+ buildgcc $PPU_TARGET ppu --with-cpu=cell
echo "******* Building PPU Newlib"
buildnewlib $PPU_TARGET ppu
echo "******* Building PPU GCC"
- EXTRAFLAGS=--with-cpu=cell buildgcc $PPU_TARGET ppu --with-newlib
+ buildgcc $PPU_TARGET ppu --with-newlib --with-cpu=cell
echo "******* Building PPU GDB"
buildgdb $PPU_TARGET ppu
echo "******* Creating symlinks!"
View
24 common.mk
@@ -0,0 +1,24 @@
+
+all: $(OBJECTS) $(OUTPUT)
+%.o: %.c
+ @echo " COMPILE $<"
+ @$(CC) $(CFLAGS) -c -o $@ $<
+%.o: %.cpp
+ @echo " COMPILE $<"
+ @$(CPP) $(CPPFLAGS) -c -o $@ $<
+%.o: %.s
+ @echo " ASSEMBLE $<"
+ @$(CC) $(CFLAGS) $(SFLAGS) -c -o $@ $<
+%.o: %.S
+ @echo " ASSEMBLE $<"
+ @$(CC) $(CFLAGS) $(SFLAGS) -c -o $@ $<
+%.elf: $(OBJECTS)
+ @echo " LINK $<"
+ @$(CC) $(OBJECTS) $(LDFLAGS) -o $@
+%.a: $(OBJECTS)
+ @echo " ARCHIVE $@"
+ @$(AR) rcs "$@" $(OBJECTS)
+clean:
+ @echo " CLEAN"
+ @$(RM) $(OUTPUT) $(OBJECTS)
+
View
9 common_pre.mk
@@ -0,0 +1,9 @@
+AS = $(PREFIX)-as
+CC = $(PREFIX)-gcc
+CPP = $(PREFIX)-g++
+LD = $(PREFIX)-ld
+CFLAGS = -nostdlib -nostartfiles -nodefaultlibs
+CPPFLAGS = $(CFLAGS)
+SFLAGS = $(CFLAGS)
+LDFLAGS = -nostdlib -s
+
View
6 ppu.mk
@@ -0,0 +1,6 @@
+PREFIX = powerpc64-linux
+
+include ../common_pre.mk
+
+SFLAGS += -mregnames
+
View
6 spu.mk
@@ -0,0 +1,6 @@
+PREFIX = spu
+
+include ../common_pre.mk
+
+SFLAGS += -mregnames
+
Please sign in to comment.
Something went wrong with that request. Please try again.