diff --git a/Makefile b/Makefile deleted file mode 100644 index e5a05af..0000000 --- a/Makefile +++ /dev/null @@ -1,34 +0,0 @@ -CC = gcc -CFLAGS += -Wall -Wextra -pedantic -CFLAGS += $(shell pkg-config --cflags dbus-1) -CFLAGS += $(shell pkg-config --cflags hidapi-hidraw) -LIBS += $(shell pkg-config --libs dbus-1) -LIBS += $(shell pkg-config --libs hidapi-hidraw) -LIBS += $(shell pkg-config --libs libudev) - -TARGET = dualsensectl -VERSION = 0.6 - -ifeq ($(BUILD),debug) -CFLAGS += -O0 -g -else -CFLAGS += -O2 -s -DNDEBUG -endif - -DEFINES += -DDUALSENSECTL_VERSION=\"$(VERSION)\" - -all: - $(CC) main.c -o $(TARGET) $(DEFINES) $(CFLAGS) $(LIBS) - -debug: - make "BUILD=debug" - -install: all - install -D -m 755 -p $(TARGET) $(DESTDIR)/usr/bin/$(TARGET) - install -D -m 644 -p completion/$(TARGET) $(DESTDIR)/usr/share/bash-completion/completions/$(TARGET) - install -D -m 644 -p completion/_$(TARGET) $(DESTDIR)/usr/share/zsh/site-functions/_$(TARGET) - -uninstall: - rm -f $(DESTDIR)/usr/bin/$(TARGET) - rm -f $(DESTDIR)/usr/share/bash-completion/completions/$(TARGET) - rm -f $(DESTDIR)/usr/share/zsh/site-functions/_$(TARGET) diff --git a/README.md b/README.md index f6e5eb5..76bd575 100644 --- a/README.md +++ b/README.md @@ -39,13 +39,17 @@ AUR: [dualsensectl-git](https://aur.archlinux.org/packages/dualsensectl-git/) ### Dependencies +* meson * libhidapi-hidraw * libdbus-1 * libudev ### Building - make && make install + meson setup build + cd build + ninja + ninja install ### udev rules diff --git a/main.c b/main.c index ff85c45..96569ce 100644 --- a/main.c +++ b/main.c @@ -5,6 +5,8 @@ * Copyright (c) 2020 Sony Interactive Entertainment */ +#define _XOPEN_SOURCE 700 + #include #include #include diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..2787356 --- /dev/null +++ b/meson.build @@ -0,0 +1,30 @@ +project( + 'dualsensectl', + 'c', + version: '0.6.0', + license: 'GPLv2', + meson_version: '>=0.58.0', + default_options: [ + 'c_std=c11', + 'warning_level=3', + ], + ) + +add_project_arguments( + [ + '-Wl,--exclude-libs=ALL', + '-DDUALSENSECTL_VERSION="@0@"'.format(meson.project_version()), + ], + language: 'c', + ) + +udev = dependency('libudev') +dbus = dependency('dbus-1') +hidapi_hidraw = dependency('hidapi-hidraw') + +executable( + 'dualsensectl', + ['main.c'], + dependencies: [udev, dbus, hidapi_hidraw], + install: true, + )