Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #PREFIX = powerpc-gekko-
  2. PREFIX = $(DEVKITPPC)/bin/powerpc-eabi-
  3. #PREFIX = /home/megazig/Wii/bootmii-utils/bin/powerpc-elf-
  4. AR = $(PREFIX)ar
  5. AS = $(PREFIX)as
  6. CC = $(PREFIX)gcc
  7. CXX = $(PREFIX)g++
  8. LD = $(PREFIX)ld
  9. OBJCOPY = $(PREFIX)objcopy
  10. RANLIB = $(PREFIX)ranlib
  11. STRIP = $(PREFIX)strip
  12. MACHDEP = -mcpu=750 -mno-eabi -mhard-float -DTINY -DDEBUG
  13. #CFLAGS = $(MACHDEP) -Os -Wall -pipe -ffunction-sections -finline-functions-called-once -mno-sdata --combine -fwhole-program -ffreestanding
  14. CFLAGS = $(MACHDEP) -O1 -Werror -Wall -pipe -ffunction-sections -finline-functions-called-once -mno-sdata
  15. LDFLAGS = $(MACHDEP) -n -nostartfiles -nostdlib -Wl,-T,openstub.ld -L.
  16. ASFLAGS = -D_LANGUAGE_ASSEMBLY -DHW_RVL -DTINY
  17. TARGET_LINKED = tinyload.elf
  18. TARGET = ../loader/data/stub.bin
  19. CFILES = ios.c utils.c cache.c usbgecko.c main.c
  20. #OBJS = crt0.o _all.o
  21. OBJS = crt0.o memory.o ios.o utils.o cache.o usbgecko.o main.o
  22. DEPDIR = .deps
  23. LIBS =
  24. all: $(TARGET)
  25. %.o: %.s
  26. @echo " ASSEMBLE $<"
  27. @$(CC) $(CFLAGS) $(DEFINES) $(ASFLAGS) -c $< -o $@
  28. %.o: %.S
  29. @echo " ASSEMBLE $<"
  30. @$(CC) $(CFLAGS) $(DEFINES) $(ASFLAGS) -c $< -o $@
  31. %.o: %.c
  32. @echo " COMPILE $<"
  33. @$(CC) $(CFLAGS) $(DEFINES) -c $< -o $@
  34. #_all.o: $(CFILES)
  35. # @echo " COMPILE ALL "
  36. # @mkdir -p $(DEPDIR)
  37. # @$(CC) $(CFLAGS) $(DEFINES) -Wp,-MMD,$(DEPDIR)/$(*F).d,-MQ,"$@",-MP -c $(CFILES) -o $@
  38. $(TARGET_LINKED): $(OBJS)
  39. @echo " LINK $@"
  40. @$(CC) -g -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
  41. $(TARGET): $(TARGET_LINKED)
  42. @echo " OBJCOPY $@"
  43. @$(OBJCOPY) -O binary $< $@
  44. clean:
  45. -$(RM) -rf $(TARGET_LINKED) $(TARGET) $(OBJS) $(DEPDIR)