Makefile 776 B

1234567891011121314151617181920212223242526272829303132333435
  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. SOURCES = . ../src ../src/adplug
  14. CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
  15. CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
  16. OFILES = $(CFILES:.c=.o) $(CPPFILES:.cpp=.o)
  17. CFLAGS = -g -Wall -O2 `sdl-config --cflags` -DGPH $(DEVICE) -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../src
  18. CXXFLAGS = $(CFLAGS)
  19. LDFLAGS = `sdl-config --libs`
  20. $(TARGET): $(OFILES)
  21. $(HOST)g++ $(OFILES) -o $@ $(LDFLAGS)
  22. %.o: %.c
  23. $(HOST)gcc $(CFLAGS) -c $< -o $@
  24. %.o: %.cpp
  25. $(HOST)g++ $(CXXFLAGS) -c $< -o $@
  26. clean:
  27. rm -f $(TARGET) $(OFILES)