Makefile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. TARGET = boot.dol
  2. INTER=.wii
  3. HOST = powerpc-eabi-
  4. DEPFLAGS = -MT $@ -MMD -MP -MF $*$(INTER).Td
  5. SOURCES = . .. ../adplug ../liboggvorbis/src ../libmad
  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. CCFLAGS = $(DFALG) -g -Wall -O2 -DGEKKO -D__POWERPC__ -D__ppc__ -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src $(DEPFLAGS) -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/ogc -I$(DEVKITPRO)/libogc/include/SDL
  11. CXXFLAGS = $(CCFLAGS) -std=c++11
  12. CFLAGS = $(CCFLAGS) -std=gnu99
  13. LDFLAGS = -L$(DEVKITPRO)/libogc/lib/wii -lSDL -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard -lg -mrvl
  14. ifeq ($(DEBUG),1)
  15. CCFLAGS += -DDEBUG -I$(DEVKITPRO)/wii_dev_debug/net_print/sockettest/source
  16. LDFLAGS += -ldb
  17. OFILES += $(DEVKITPRO)/wii_dev_debug/net_print/sockettest/build/net_print.o
  18. endif
  19. POSTCOMPILE = @mv -f $*$(INTER).Td $*$(INTER).d && touch $@
  20. .PHONY : all clean check
  21. all: $(TARGET)
  22. debug:
  23. $(MAKE) debug-clean
  24. $(MAKE) "DEBUG=1" -C .
  25. debug-clean:
  26. -@rm pal_utils.wii.*
  27. test: $(TARGET).elf
  28. wiiload $<
  29. $(TARGET).elf: $(OFILES)
  30. @echo [LD] $@
  31. @$(HOST)g++ $(OFILES) -o $@ $(LDFLAGS)
  32. $(TARGET): $(TARGET).elf
  33. @echo [elf2dol] $@
  34. @elf2dol $< $(TARGET)
  35. %$(INTER).o: %.c %$(INTER).d
  36. @echo [CC] $<
  37. @$(HOST)gcc $(CFLAGS) -c $< -o $@
  38. $(POSTCOMPILE)
  39. %$(INTER).o: %.cpp %$(INTER).d
  40. @echo [CC] $<
  41. @$(HOST)g++ $(CXXFLAGS) -c $< -o $@
  42. $(POSTCOMPILE)
  43. clean:
  44. -rm -f $(TARGET).elf $(TARGET) $(OFILES) $(DEPFILES)
  45. %.d: ;
  46. .PRECIOUS: %.d
  47. -include $(DEPFILES)