Makefile 1.0 KB

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