From dcfe86f661a3f88815af78150dc8544fc9cd8e31 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 23 Jul 2022 12:48:35 -0700 Subject: [PATCH] Improved makefile --- Makefile | 16 ++++++++++++---- src/main.cpp | 6 ++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 46dc2d2..a9f95af 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,10 @@ clean: libs: $(BUILD_DIR)/hid.o $(BUILD_DIR)/libmpdclient.o -.PHONY: clean all run libs +submodules: + git submodule update --init --recursive + +.PHONY: clean all run libs submodules ################################################# # Flags and autodetection @@ -28,11 +31,14 @@ CPPFLAGS := -MMD -MP \ -I libs/hidapi/hidapi \ -I libs/spdlog/include \ -I libs/libmpdclient/include \ - -I libs/libmpdclient/output + -I libs/libmpdclient/output \ + $(shell pkg-config --cflags hunspell) # udev: required by hidapi -# TODO: better hunspell link -LDFLAGS := -l fftw3 -l udev -l hunspell-1.7 +LDFLAGS := \ + -l fftw3 \ + -l udev \ + $(shell pkg-config --libs hunspell) # Find all cpp files in source dirs SRCS := $(shell find $(SRC_DIRS) -name '*.cpp') @@ -63,6 +69,8 @@ $(BUILD_DIR)/hid.o: # Build libmpdclient $(BUILD_DIR)/libmpdclient.o: + @mkdir -p $(BUILD_DIR) + @cd libs/libmpdclient && \ meson . output && \ ninja -C output diff --git a/src/main.cpp b/src/main.cpp index 72416b5..dd2b7b7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,10 +11,8 @@ #include // MPD client #include "mpd/client.h" - -// TODO: Include this properly -#include "/usr/include/hunspell/hunspell.hxx" - +// Spell checking +#include "hunspell.hxx" // Local files #include "utility/bitmap.hpp" #include "utility/buffer.hpp"