Makefile 909 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. TARGET = sdlpal.dge
  2. HOST = mipsel-linux-uclibc-
  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` -DDINGOO -DPAL_CLASSIC -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src $(DEPFLAGS)
  10. CXXFLAGS = $(CFLAGS)
  11. LDFLAGS = `sdl-config --libs`
  12. POSTCOMPILE = @mv -f $*.Td $*.d && touch $@
  13. $(TARGET): $(OFILES)
  14. @echo [LD] $@
  15. @$(HOST)g++ $(OFILES) -o $@ $(LDFLAGS)
  16. %.o: %.c %.d
  17. @echo [CC] $<
  18. @$(HOST)gcc $(CFLAGS) -c $< -o $@
  19. $(POSTCOMPILE)
  20. %.o: %.cpp %.d
  21. @echo [CC] $<
  22. @$(HOST)g++ $(CXXFLAGS) -c $< -o $@
  23. $(POSTCOMPILE)
  24. clean:
  25. rm -f $(TARGET) $(OFILES) $(DEPFILES)
  26. %.d: ;
  27. .PRECIOUS: %.d
  28. -include $(DEPFILES)