Makefile 446 B

12345678910111213141516171819202122232425
  1. CFLAGS = -Wall -Wextra -mtune=native `sdl2-config --cflags`
  2. LDFLAGS = `sdl2-config --libs` -lSDL2_image -lSDL2_mixer -lm
  3. .SUFFIXES:
  4. .SUFFIXES: .c .o
  5. TARGETS = sm
  6. .PHONY: all
  7. all: $(TARGETS)
  8. sm: main.cpp slider.o song.o
  9. g++ $(CFLAGS) -o $@ $+ $(LDFLAGS)
  10. slider.o: slider.cpp
  11. g++ $(CFLAGS) -c -o $@ $+ $(LDFLAGS)
  12. song.o: $(srcdir)song.cpp
  13. g++ $(CFLAGS) -c -o $@ $+ $(LDFLAGS)
  14. .PHONY: clean
  15. clean:
  16. @rm $(TARGETS) 2>/dev/null || true