mouse_m908/makefile

295 lines
9 KiB
Makefile
Raw Normal View History

2020-03-17 14:07:19 -06:00
# paths for the installation
2020-03-17 13:47:30 -06:00
PREFIX = /usr
BIN_DIR = $(PREFIX)/bin
DOC_DIR = $(PREFIX)/share/doc
MAN_DIR = $(PREFIX)/share/man/man1
ETC_DIR = /etc
2020-03-17 13:47:30 -06:00
2020-04-08 07:39:30 -06:00
# compiler options
2021-01-21 15:59:43 -07:00
CC = c++
CC_OPTIONS := -std=c++17 -Wall -Wextra -O2 `pkg-config --cflags libusb-1.0`
2020-04-19 06:51:05 -06:00
LIBS != pkg-config --libs libusb-1.0
2020-04-08 07:39:30 -06:00
2020-05-02 08:50:55 -06:00
# version string
2020-11-10 09:47:05 -07:00
VERSION_STRING = "\"3.1\""
2020-05-02 08:50:55 -06:00
# compile
2021-04-03 14:18:26 -06:00
build: m908 m709 m711 m715 m719 m913 m990 m990chroma generic data_rd.o rd_mouse.o load_config.o mouse_m908.o
2020-04-08 07:39:30 -06:00
$(CC) *.o -o mouse_m908 $(LIBS) $(CC_OPTIONS)
2019-11-08 17:10:30 -07:00
2020-03-17 14:07:19 -06:00
# copy all files to their correct location
2019-11-08 17:10:30 -07:00
install:
2019-11-29 16:15:54 -07:00
cp ./mouse_m908 $(BIN_DIR)/mouse_m908 && \
cp ./mouse_m908.rules $(ETC_DIR)/udev/rules.d && \
2020-03-17 13:47:30 -06:00
mkdir $(DOC_DIR)/mouse_m908 | true && \
2020-07-20 13:22:21 -06:00
cp ./examples/* $(DOC_DIR)/mouse_m908/ && \
2020-03-17 13:47:30 -06:00
cp ./README.md $(DOC_DIR)/mouse_m908/ && \
2020-03-17 14:07:19 -06:00
cp ./keymap.md $(DOC_DIR)/mouse_m908/ && \
2020-03-17 13:47:30 -06:00
cp ./mouse_m908.1 $(MAN_DIR)/
2019-11-29 16:15:54 -07:00
2020-06-13 08:26:01 -06:00
install-bsd:
cp ./mouse_m908 $(BIN_DIR)/mouse_m908 && \
mkdir $(DOC_DIR)/mouse_m908 | true && \
2020-07-20 13:22:21 -06:00
cp ./examples/* $(DOC_DIR)/mouse_m908/ && \
2020-06-13 08:26:01 -06:00
cp ./README.md $(DOC_DIR)/mouse_m908/ && \
cp ./keymap.md $(DOC_DIR)/mouse_m908/ && \
cp ./mouse_m908.1 $(MAN_DIR)/
2020-03-17 14:07:19 -06:00
# remove binary
2019-11-29 16:15:54 -07:00
clean:
2021-02-06 14:43:02 -07:00
rm -f mouse_m908 *.o mouse_m908*.rpm
rm -rf Haiku/bin Haiku/documentation Haiku/mouse_m908.hpkg
2019-11-29 16:15:54 -07:00
2020-03-17 14:07:19 -06:00
# remove all installed files
2019-11-29 16:15:54 -07:00
uninstall:
2020-03-17 13:47:30 -06:00
rm -f $(BIN_DIR)/mouse_m908 && \
rm -f $(ETC_DIR)/udev/rules.d/mouse_m908.rules && \
2020-03-17 13:47:30 -06:00
rm -rf $(DOC_DIR)/mouse_m908 && \
rm -f $(MAN_DIR)/mouse_m908.1
2019-11-29 16:15:54 -07:00
2020-03-17 14:07:19 -06:00
# this is an alias to install for backwards compatibility
2020-03-17 13:47:30 -06:00
upgrade: install
2020-02-07 19:58:22 -07:00
# this builds a .rpm for Fedora/RHEL systems
rpm:
rpmbuild --buildroot $(PWD)/rpmbuild/BUILDROOT --define "_topdir $(PWD)/rpmbuild" -bb mouse_m908.spec
# this builds .src.rpm for Fedora/RHEL systems
src-rpm:
rpmbuild --buildroot $(PWD)/rpmbuild/BUILDROOT --define "_topdir $(PWD)/rpmbuild" -bs mouse_m908.spec
2020-05-27 08:55:04 -06:00
# this builds a .hpkg package on Haiku
hpkg:
mkdir Haiku/bin
mkdir -p Haiku/documentation/man/man1
mkdir -p Haiku/documentation/packages/mouse_m908
cp mouse_m908 Haiku/bin
cp mouse_m908.1 Haiku/documentation/man/man1
2020-07-29 15:50:14 -06:00
cp examples/* Haiku/documentation/packages/mouse_m908
2020-05-27 08:55:04 -06:00
cp README.md Haiku/documentation/packages/mouse_m908
cp keymap.md Haiku/documentation/packages/mouse_m908
cd Haiku; \
package create -b mouse_m908.hpkg; \
package add mouse_m908.hpkg bin documentation
2020-07-31 10:41:47 -06:00
# targets for the different mice
m908: constructor_m908.o data_m908.o getters_m908.o helpers_m908.o setters_m908.o writers_m908.o readers_m908.o
m709: constructor_m709.o data_m709.o getters_m709.o helpers_m709.o setters_m709.o writers_m709.o readers_m709.o
2020-07-31 10:41:47 -06:00
m711: constructor_m711.o data_m711.o getters_m711.o helpers_m711.o setters_m711.o writers_m711.o readers_m711.o
2020-08-29 09:00:34 -06:00
m715: constructor_m715.o data_m715.o getters_m715.o helpers_m715.o setters_m715.o writers_m715.o readers_m715.o
2021-04-03 14:18:26 -06:00
m719: constructor_m719.o data_m719.o getters_m719.o helpers_m719.o setters_m719.o writers_m719.o readers_m719.o
2021-02-28 09:15:47 -07:00
m913: constructor_m913.o data_m913.o getters_m913.o helpers_m913.o setters_m913.o writers_m913.o readers_m913.o
2020-11-12 07:10:59 -07:00
m990: constructor_m990.o data_m990.o getters_m990.o helpers_m990.o setters_m990.o writers_m990.o readers_m990.o
2020-12-20 12:08:39 -07:00
m990chroma: constructor_m990chroma.o data_m990chroma.o getters_m990chroma.o helpers_m990chroma.o setters_m990chroma.o writers_m990chroma.o readers_m990chroma.o
2020-11-10 08:06:17 -07:00
generic: constructor_generic.o data_generic.o getters_generic.o helpers_generic.o setters_generic.o writers_generic.o readers_generic.o
2020-04-08 07:39:30 -06:00
# individual files
mouse_m908.o:
2020-05-02 08:50:55 -06:00
$(CC) -c mouse_m908.cpp $(CC_OPTIONS) -D VERSION_STRING=$(VERSION_STRING)
2020-04-08 07:39:30 -06:00
2020-07-12 12:35:13 -06:00
load_config.o:
$(CC) -c include/load_config.cpp $(CC_OPTIONS)
2020-04-08 07:39:30 -06:00
2020-07-12 12:35:13 -06:00
data_rd.o:
2020-04-08 07:39:30 -06:00
$(CC) -c include/data.cpp $(CC_OPTIONS)
2020-08-14 11:33:57 -06:00
rd_mouse.o:
$(CC) -c include/rd_mouse.cpp $(CC_OPTIONS)
2020-07-12 12:35:13 -06:00
constructor_m908.o:
$(CC) -c include/m908/constructor.cpp $(CC_OPTIONS) -o constructor_m908.o
2020-04-08 07:39:30 -06:00
2020-07-12 12:35:13 -06:00
data_m908.o:
$(CC) -c include/m908/data.cpp $(CC_OPTIONS) -o data_m908.o
2020-04-08 07:39:30 -06:00
2020-07-12 12:35:13 -06:00
getters_m908.o:
$(CC) -c include/m908/getters.cpp $(CC_OPTIONS) -o getters_m908.o
helpers_m908.o:
$(CC) -c include/m908/helpers.cpp $(CC_OPTIONS) -o helpers_m908.o
2020-04-08 07:39:30 -06:00
2020-07-12 12:35:13 -06:00
setters_m908.o:
$(CC) -c include/m908/setters.cpp $(CC_OPTIONS) -o setters_m908.o
2020-04-08 07:39:30 -06:00
2020-07-12 12:35:13 -06:00
writers_m908.o:
$(CC) -c include/m908/writers.cpp $(CC_OPTIONS) -o writers_m908.o
2020-05-09 14:33:14 -06:00
2020-07-12 12:35:13 -06:00
readers_m908.o:
$(CC) -c include/m908/readers.cpp $(CC_OPTIONS) -o readers_m908.o
constructor_m709.o:
$(CC) -c include/m709/constructor.cpp $(CC_OPTIONS) -o constructor_m709.o
data_m709.o:
$(CC) -c include/m709/data.cpp $(CC_OPTIONS) -o data_m709.o
getters_m709.o:
$(CC) -c include/m709/getters.cpp $(CC_OPTIONS) -o getters_m709.o
helpers_m709.o:
$(CC) -c include/m709/helpers.cpp $(CC_OPTIONS) -o helpers_m709.o
setters_m709.o:
$(CC) -c include/m709/setters.cpp $(CC_OPTIONS) -o setters_m709.o
writers_m709.o:
$(CC) -c include/m709/writers.cpp $(CC_OPTIONS) -o writers_m709.o
readers_m709.o:
$(CC) -c include/m709/readers.cpp $(CC_OPTIONS) -o readers_m709.o
2020-07-31 10:41:47 -06:00
constructor_m711.o:
$(CC) -c include/m711/constructor.cpp $(CC_OPTIONS) -o constructor_m711.o
data_m711.o:
$(CC) -c include/m711/data.cpp $(CC_OPTIONS) -o data_m711.o
getters_m711.o:
$(CC) -c include/m711/getters.cpp $(CC_OPTIONS) -o getters_m711.o
helpers_m711.o:
$(CC) -c include/m711/helpers.cpp $(CC_OPTIONS) -o helpers_m711.o
setters_m711.o:
$(CC) -c include/m711/setters.cpp $(CC_OPTIONS) -o setters_m711.o
writers_m711.o:
$(CC) -c include/m711/writers.cpp $(CC_OPTIONS) -o writers_m711.o
readers_m711.o:
$(CC) -c include/m711/readers.cpp $(CC_OPTIONS) -o readers_m711.o
2020-08-29 09:00:34 -06:00
constructor_m715.o:
$(CC) -c include/m715/constructor.cpp $(CC_OPTIONS) -o constructor_m715.o
data_m715.o:
$(CC) -c include/m715/data.cpp $(CC_OPTIONS) -o data_m715.o
getters_m715.o:
$(CC) -c include/m715/getters.cpp $(CC_OPTIONS) -o getters_m715.o
helpers_m715.o:
$(CC) -c include/m715/helpers.cpp $(CC_OPTIONS) -o helpers_m715.o
setters_m715.o:
$(CC) -c include/m715/setters.cpp $(CC_OPTIONS) -o setters_m715.o
writers_m715.o:
$(CC) -c include/m715/writers.cpp $(CC_OPTIONS) -o writers_m715.o
readers_m715.o:
$(CC) -c include/m715/readers.cpp $(CC_OPTIONS) -o readers_m715.o
2020-11-10 08:06:17 -07:00
2021-04-03 14:18:26 -06:00
constructor_m719.o:
$(CC) -c include/m719/constructor.cpp $(CC_OPTIONS) -o constructor_m719.o
data_m719.o:
$(CC) -c include/m719/data.cpp $(CC_OPTIONS) -o data_m719.o
getters_m719.o:
$(CC) -c include/m719/getters.cpp $(CC_OPTIONS) -o getters_m719.o
helpers_m719.o:
$(CC) -c include/m719/helpers.cpp $(CC_OPTIONS) -o helpers_m719.o
setters_m719.o:
$(CC) -c include/m719/setters.cpp $(CC_OPTIONS) -o setters_m719.o
writers_m719.o:
$(CC) -c include/m719/writers.cpp $(CC_OPTIONS) -o writers_m719.o
readers_m719.o:
$(CC) -c include/m719/readers.cpp $(CC_OPTIONS) -o readers_m719.o
2020-11-10 08:06:17 -07:00
constructor_generic.o:
$(CC) -c include/generic/constructor.cpp $(CC_OPTIONS) -o constructor_generic.o
data_generic.o:
$(CC) -c include/generic/data.cpp $(CC_OPTIONS) -o data_generic.o
getters_generic.o:
$(CC) -c include/generic/getters.cpp $(CC_OPTIONS) -o getters_generic.o
helpers_generic.o:
$(CC) -c include/generic/helpers.cpp $(CC_OPTIONS) -o helpers_generic.o
setters_generic.o:
$(CC) -c include/generic/setters.cpp $(CC_OPTIONS) -o setters_generic.o
writers_generic.o:
$(CC) -c include/generic/writers.cpp $(CC_OPTIONS) -o writers_generic.o
readers_generic.o:
$(CC) -c include/generic/readers.cpp $(CC_OPTIONS) -o readers_generic.o
2020-11-12 07:10:59 -07:00
2021-02-28 09:15:47 -07:00
constructor_m913.o:
$(CC) -c include/m913/constructor.cpp $(CC_OPTIONS) -o constructor_m913.o
data_m913.o:
$(CC) -c include/m913/data.cpp $(CC_OPTIONS) -o data_m913.o
getters_m913.o:
$(CC) -c include/m913/getters.cpp $(CC_OPTIONS) -o getters_m913.o
helpers_m913.o:
$(CC) -c include/m913/helpers.cpp $(CC_OPTIONS) -o helpers_m913.o
setters_m913.o:
$(CC) -c include/m913/setters.cpp $(CC_OPTIONS) -o setters_m913.o
writers_m913.o:
$(CC) -c include/m913/writers.cpp $(CC_OPTIONS) -o writers_m913.o
readers_m913.o:
$(CC) -c include/m913/readers.cpp $(CC_OPTIONS) -o readers_m913.o
2020-11-12 07:10:59 -07:00
constructor_m990.o:
$(CC) -c include/m990/constructor.cpp $(CC_OPTIONS) -o constructor_m990.o
data_m990.o:
$(CC) -c include/m990/data.cpp $(CC_OPTIONS) -o data_m990.o
getters_m990.o:
$(CC) -c include/m990/getters.cpp $(CC_OPTIONS) -o getters_m990.o
helpers_m990.o:
$(CC) -c include/m990/helpers.cpp $(CC_OPTIONS) -o helpers_m990.o
setters_m990.o:
$(CC) -c include/m990/setters.cpp $(CC_OPTIONS) -o setters_m990.o
writers_m990.o:
$(CC) -c include/m990/writers.cpp $(CC_OPTIONS) -o writers_m990.o
readers_m990.o:
$(CC) -c include/m990/readers.cpp $(CC_OPTIONS) -o readers_m990.o
2020-12-20 12:08:39 -07:00
constructor_m990chroma.o:
$(CC) -c include/m990chroma/constructor.cpp $(CC_OPTIONS) -o constructor_m990chroma.o
data_m990chroma.o:
$(CC) -c include/m990chroma/data.cpp $(CC_OPTIONS) -o data_m990chroma.o
getters_m990chroma.o:
$(CC) -c include/m990chroma/getters.cpp $(CC_OPTIONS) -o getters_m990chroma.o
helpers_m990chroma.o:
$(CC) -c include/m990chroma/helpers.cpp $(CC_OPTIONS) -o helpers_m990chroma.o
setters_m990chroma.o:
$(CC) -c include/m990chroma/setters.cpp $(CC_OPTIONS) -o setters_m990chroma.o
writers_m990chroma.o:
$(CC) -c include/m990chroma/writers.cpp $(CC_OPTIONS) -o writers_m990chroma.o
readers_m990chroma.o:
$(CC) -c include/m990chroma/readers.cpp $(CC_OPTIONS) -o readers_m990chroma.o