Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. TARGET = boot
  2. INTER=.wii
  3. HOST = powerpc-eabi-
  4. DEPFLAGS = -MT $@ -MMD -MP -MF $*$(INTER).Td
  5. SOURCES = . .. ../adplug
  6. CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
  7. CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
  8. OFILES = $(CFILES:.c=$(INTER).o) $(CPPFILES:.cpp=$(INTER).o)
  9. DEPFILES = $(OFILES:.o=.d)
  10. CFLAGS = -g -Wall -O2 `sdl-config --cflags` -DGEKKO -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src $(DEPFLAGS)
  11. CXXFLAGS = $(CFLAGS)
  12. LDFLAGS = `sdl-config --libs` -DGEKKO -mrvl
  13. POSTCOMPILE = @mv -f $*$(INTER).Td $*$(INTER).d && touch $@
  14. $(TARGET): $(OFILES)
  15. @echo [LD] $@
  16. @$(HOST)g++ $(OFILES) -o $@.elf $(LDFLAGS)
  17. @elf2dol $(TARGET).elf $(TARGET).dol
  18. %$(INTER).o: %.c %$(INTER).d
  19. @echo [CC] $<
  20. @$(HOST)gcc $(CFLAGS) -c $< -o $@
  21. $(POSTCOMPILE)
  22. %$(INTER).o: %.cpp %$(INTER).d
  23. @echo [CC] $<
  24. @$(HOST)g++ $(CXXFLAGS) -c $< -o $@
  25. $(POSTCOMPILE)
  26. clean:
  27. rm -f $(TARGET).elf $(TARGET).dol $(OFILES) $(DEPFILES)
  28. %.d: ;
  29. .PRECIOUS: %.d
  30. -include $(DEPFILES)