Files
kindle2notes/debian/rules
T
2026-08-28 01:46:43 -04:00

45 lines
1.4 KiB
Makefile
Executable File

#!/usr/bin/make -f
include /usr/share/dpkg/architecture.mk
include /usr/share/dpkg/buildflags.mk
PACKAGE := kindle2notes
BUILD_DIR := build-debian
PACKAGE_DIR := $(CURDIR)/debian/$(PACKAGE)
PACKAGE_VERSION := $(shell dpkg-parsechangelog -S Version)
.PHONY: clean build build-arch build-indep binary binary-arch binary-indep
clean:
rm -rf $(BUILD_DIR) $(PACKAGE_DIR)
rm -f debian/files debian/*.substvars
build: build-arch build-indep
build-arch:
cmake -S . -B $(BUILD_DIR) \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DKINDLE2NOTES_VERSION=$(PACKAGE_VERSION) \
-DCMAKE_CXX_FLAGS="$(CXXFLAGS) $(CPPFLAGS)" \
-DCMAKE_EXE_LINKER_FLAGS="$(LDFLAGS)"
cmake --build $(BUILD_DIR) --parallel
build-indep:
binary: binary-arch binary-indep
binary-arch: build-arch
DESTDIR=$(PACKAGE_DIR) cmake --install $(BUILD_DIR)
strip --strip-unneeded $(PACKAGE_DIR)/usr/bin/$(PACKAGE)
install -d $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE)
install -m 0644 debian/copyright $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE)/copyright
install -m 0644 README.md $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE)/README.md
gzip -n -9 -c debian/changelog > $(PACKAGE_DIR)/usr/share/doc/$(PACKAGE)/changelog.Debian.gz
install -d $(PACKAGE_DIR)/DEBIAN
dpkg-shlibdeps -Tdebian/$(PACKAGE).substvars debian/$(PACKAGE)/usr/bin/$(PACKAGE)
dpkg-gencontrol -p$(PACKAGE) -P$(PACKAGE_DIR) -Tdebian/$(PACKAGE).substvars
dpkg-deb --build --root-owner-group $(PACKAGE_DIR) ..
binary-indep: