tmus

TUI Music Player
git clone https://git.sinitax.com/sinitax/tmus
Log | Files | Refs | Submodules | LICENSE | sfeed.txt

Makefile (1287B)


      1CFLAGS = -I src -g $(shell pkg-config --cflags glib-2.0 dbus-1)
      2CFLAGS += -I lib/liblist/include -I lib/libgrapheme/
      3CFLAGS += -Wunused-variable -Wmissing-prototypes
      4LDLIBS = -lcurses $(shell pkg-config --libs glib-2.0 dbus-1)
      5DEPFLAGS = -MT $@ -MMD -MP -MF build/$*.d
      6
      7ifeq "$(PROF)" "YES"
      8	CFLAGS += -pg
      9endif
     10
     11BACKEND ?= mplay
     12
     13ifeq "$(BACKEND)" "mplay"
     14	CFLAGS += -I lib/mplay
     15endif
     16
     17ifeq "$(BACKEND)" "mpd"
     18	LDLIBS += -lmpdclient
     19endif
     20
     21SRCS = $(filter-out src/player_%.c, $(wildcard src/*.c))
     22OBJS = $(SRCS:src/%.c=build/%.o) build/player_$(BACKEND).o
     23DEPS = $(OBJS:%.o=%.d)
     24
     25LIBLIST_A = lib/liblist/build/liblist.a
     26LIBGRAPHEME_A = lib/libgrapheme/libgrapheme.a
     27
     28PREFIX ?= /usr/local
     29BINDIR ?= /bin
     30
     31all: tmus
     32
     33clean:
     34	rm -rf build
     35
     36cleanlibs:
     37	rm -rf lib/liblist/build
     38
     39build:
     40	mkdir build
     41
     42build/%.o: src/%.c build/%.d | build
     43	$(CC) -c -o $@ $(DEPFLAGS) $(CFLAGS) $<
     44
     45build/%.d: | build;
     46
     47include $(DEPS)
     48
     49$(LIBLIST_A):
     50	make -C lib/liblist DEBUG=1 build/liblist.a
     51
     52$(LIBGRAPHEME_A):
     53	make -C lib/libgrapheme DEBUG=1 libgrapheme.a
     54
     55tmus: $(OBJS) $(LIBLIST_A) $(LIBGRAPHEME_A)
     56	$(CC) -o tmus $^ $(CFLAGS) $(LDLIBS)
     57
     58install: tmus
     59	install -m755 $< -t "$(DESTDIR)$(PREFIX)$(BINDIR)"
     60
     61uninstall:
     62	rm -f "$(DESTDIR)$(PREFIX)$(BINDIR)"
     63
     64.PHONY: all clean cleanlibs install uninstall