Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. CFLAGS:= -g `sdl2-config --cflags`
  2. LDFLAGS:= `sdl2-config --libs` -lSDL2_ttf -lSDL2_image -lm -lavformat
  3. FFLAGS:= #-fsanitize=thread
  4. CXX:= gcc #-pg
  5. PROG:= cmus-rg
  6. DESTDIR:=
  7. PREFIX:=
  8. OBJS:= init.o metadata.o commands.o graphics.o input.o util.o parser.o cmus-rg.o main.o
  9. all: $(PROG)
  10. %.o: src/%.c src/%.h src/def.h
  11. $(CXX) $(CFLAGS) -c $<
  12. $(PROG): $(OBJS)
  13. $(CXX) -Wall -Wextra -std=c99 -pedantic $(FFLAGS) -g $(OBJS) -o $(PROG) $(LDFLAGS)
  14. install: all
  15. @echo installing executable file to ${DESTDIR}${PREFIX}/bin
  16. @mkdir -p ${DESTDIR}${PREFIX}/bin
  17. @cp -f cmus-rg ${DESTDIR}${PREFIX}/bin
  18. @chmod 755 ${DESTDIR}${PREFIX}/bin/cmus-rg
  19. @echo installing font file to ${DESTDIR}${PREFIX}/usr/share/fonts/TTF
  20. @mkdir -p ${DESTDIR}${PREFIX}/usr/share/fonts/TTF
  21. @cp -f src/font/mplus-1m-regular.ttf ${DESTDIR}${PREFIX}/usr/share/fonts/TTF
  22. uninstall:
  23. @echo removing executable file from ${DESTDIR}${PREFIX}/bin
  24. @rm -f ${DESTDIR}${PREFIX}/bin/cmus-rg
  25. @echo removing font file from ${DESTDIR}${PREFIX}/usr/share/fonts/TTF
  26. @rm -f ${DESTDIR}${PREFIX}/usr/share/fonts/TTF/mplus-1m-regular.ttf
  27. clean:
  28. rm -f $(PROG) *.o