Makefile 652 B

12345678910111213141516171819202122232425
  1. TARGET = boot
  2. HOST = powerpc-eabi-
  3. SOURCES = . ../src ../src/adplug
  4. CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
  5. CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
  6. OFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
  7. CFLAGS = -g -Wall -O2 `sdl-config --cflags` -DGEKKO -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../src
  8. CXXFLAGS = $(CFLAGS)
  9. LDFLAGS = `sdl-config --libs` -DGEKKO -mrvl
  10. $(TARGET): $(OFILES)
  11. $(HOST)g++ $(OFILES) -o $@.elf $(LDFLAGS)
  12. elf2dol $(TARGET).elf $(TARGET).dol
  13. %.o: %.c
  14. $(HOST)gcc $(CFLAGS) -c $< -o $@
  15. %.o: %.cpp
  16. $(HOST)g++ $(CXXFLAGS) -c $< -o $@
  17. clean:
  18. rm -f $(TARGET).elf $(TARGET).dol $(OFILES)