Makefile 996 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. TARGET = sdlpal.dge
  2. INTER=.dingux
  3. HOST = mipsel-linux-uclibc-
  4. DEPFLAGS = -MT $@ -MMD -MP -MF $*$(INTER).Td
  5. SOURCES = . ./adplug
  6. CFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
  7. CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
  8. OFILES = $(CFILES:.c=$(INTER).o) $(CPPFILES:.cpp=$(INTER).o)
  9. DEPFILES = $(OFILES:.o=.d)
  10. CFLAGS = -g -Wall -O2 `sdl-config --cflags` -DDINGOO -DPAL_CLASSIC -DPAL_HAS_PLATFORM_SPECIFIC_UTILS -I. -I../ -I../liboggvorbis/include -I../liboggvorbis/src $(DEPFLAGS)
  11. CXXFLAGS = $(CFLAGS)
  12. LDFLAGS = `sdl-config --libs`
  13. POSTCOMPILE = @mv -f $*$(INTER).Td $*$(INTER).d && touch $@
  14. $(TARGET): $(OFILES)
  15. @echo [LD] $@
  16. @$(HOST)g++ $(OFILES) -o $@ $(LDFLAGS)
  17. %$(INTER).o: %.c %$(INTER).d
  18. @echo [CC] $<
  19. @$(HOST)gcc $(CFLAGS) -c $< -o $@
  20. $(POSTCOMPILE)
  21. %$(INTER).o: %.cpp %$(INTER).d
  22. @echo [CC] $<
  23. @$(HOST)g++ $(CXXFLAGS) -c $< -o $@
  24. $(POSTCOMPILE)
  25. clean:
  26. rm -f $(TARGET) $(OFILES) $(DEPFILES)
  27. %.d: ;
  28. .PRECIOUS: %.d
  29. -include $(DEPFILES)