Makefile 960 B

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