Makefile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. BUILD_GP2XWIZ = NO
  2. BUILD_CAANOO = YES
  3. TARGET = sdlpal.gpe
  4. INTER=.gph
  5. ifeq ($(BUILD_GP2XWIZ), YES)
  6. HOST = arm-open2x-linux-
  7. DEVICE = -DGP2XWIZ
  8. else
  9. ifeq ($(BUILD_CAANOO), YES)
  10. HOST = arm-gph-linux-gnueabi-
  11. DEVICE = -DCAANOO
  12. endif
  13. endif
  14. DEPFLAGS = -MT $@ -MMD -MP -MF $*$(INTER).Td
  15. SOURCES = . .. ../adplug
  16. CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
  17. CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
  18. OFILES = $(CFILES:.c=$(INTER).o) $(CPPFILES:.cpp=$(INTER).o)
  19. DEPFILES = $(OFILES:.o=.d)
  20. CFLAGS = -g -Wall -O2 `sdl-config --cflags` -DGPH $(DEVICE) -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src $(DEPFLAGS)
  21. CXXFLAGS = $(CFLAGS)
  22. LDFLAGS = `sdl-config --libs`
  23. POSTCOMPILE = @mv -f $*$(INTER).Td $*$(INTER).d && touch $@
  24. $(TARGET): $(OFILES)
  25. @echo [LD] $@
  26. @$(HOST)g++ $(OFILES) -o $@ $(LDFLAGS)
  27. %$(INTER).o: %.c %$(INTER).d
  28. @echo [CC] $<
  29. @$(HOST)gcc $(CFLAGS) -c $< -o $@
  30. $(POSTCOMPILE)
  31. %$(INTER).o: %.cpp %$(INTER).d
  32. @echo [CC] $<
  33. @$(HOST)g++ $(CXXFLAGS) -c $< -o $@
  34. $(POSTCOMPILE)
  35. clean:
  36. rm -f $(TARGET) $(OFILES) $(DEPFILES)
  37. %.d: ;
  38. .PRECIOUS: %.d
  39. -include $(DEPFILES)