Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@
*.exe
*.out
*.app

mpdas
tests/mpdas_tests
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ VERSION = 0.4.3

CXX ?= g++
OBJ = main.o md5.o utils.o mpd.o audioscrobbler.o cache.o config.o
MAIN_OBJ = main.o
TESTS_DIR = tests
TESTS_OBJ = tests.o
OUT = mpdas
TESTS_OUT = mpdas_tests
PREFIX ?= /usr/local
MANPREFIX ?= ${PREFIX}/man/man1
CONFIG ?= $(PREFIX)/etc
Expand All @@ -13,7 +17,7 @@ LIBS = `pkg-config --libs libmpdclient libcurl`
CXXFLAGS += -DCONFDIR="\"$(CONFIG)\"" -DVERSION="\"$(VERSION)\""


all: $(OUT)
all: $(OUT) $(TESTS_OUT)

.cpp.o:
@echo [CXX] $<
Expand All @@ -23,8 +27,12 @@ $(OUT): $(OBJ)
@echo [LD] $@
@$(CXX) $(LDFLAGS) $(OBJ) $(LIBS) -o $(OUT)

$(TESTS_OUT): $(OBJ) $(TESTS_DIR)/$(TESTS_OBJ)
@echo [LD] $@
@$(CXX) $(LDFLAGS) $(filter-out $(MAIN_OBJ), $(OBJ)) $(TESTS_DIR)/$(TESTS_OBJ) $(LIBS) -o $(TESTS_DIR)/$(TESTS_OUT)

clean:
rm -rf $(OBJ) $(OUT)
rm -rf $(OBJ) $(OUT) $(TESTS_DIR)/$(TESTS_OBJ) $(TESTS_DIR)/$(TESTS_OUT)

install: all
install -d ${DESTDIR}${PREFIX}/bin
Expand Down
Loading