From fedb30394ae6ca49320696440cc9fd5a3bf64054 Mon Sep 17 00:00:00 2001 From: Zack Buhman Date: Mon, 30 Dec 2024 17:14:42 -0600 Subject: [PATCH] Makefile add install target --- tools/Makefile | 17 ++++++++++++++--- tools/source_dist.sh | 2 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index 6014392..efa6ffa 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,10 +1,13 @@ -CFLAGS = -Og -g -gdwarf-4 -Wall -Wextra -Werror -Wfatal-errors -ggdb -fstack-protector-strong +CFLAGS = -Og -g -gdwarf-4 -Wall -Wextra -Wno-error CFLAGS += -Wno-error=unused-parameter CFLAGS += -Wno-error=unused-variable CFLAGS += -Wno-error=unused-but-set-variable -CFLAGS += -Wno-vla-cxx-extension +CFLAGS += -Wno-vla-extension CXXFLAGS = -std=c++23 +PREFIX ?= /usr/local +MANPREFIX = $(PREFIX)/share/man + FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2) FREETYPE_LDFLAGS = $(shell pkg-config --libs freetype2) @@ -38,10 +41,18 @@ ttf_outline: ttf_outline.o ttf_2d_pack.o clean: rm -f *.o ttf_outline +install: + mkdir -p $(DESTDIR)$(PREFIX)/bin + cp -f ftdi_transfer $(DESTDIR)$(PREFIX)/bin + chmod 755 $(DESTDIR)$(PREFIX)/bin/ftdi_transfer + mkdir -p $(DESTDIR)$(MANPREFIX)/man1 + cp -f ftdi_transfer.1 $(DESTDIR)$(MANPREFIX)/man1 + chmod 644 $(DESTDIR)$(MANPREFIX)/man1/ftdi_transfer.1 + .SUFFIXES: .INTERMEDIATE: .SECONDARY: -.PHONY: all clean +.PHONY: all clean install %: RCS/%,v %: RCS/% diff --git a/tools/source_dist.sh b/tools/source_dist.sh index 47355f5..7cd3dcf 100644 --- a/tools/source_dist.sh +++ b/tools/source_dist.sh @@ -1,3 +1,5 @@ +#!/bin/sh + rm -rf ftdi_transfer_source mkdir -p ftdi_transfer_source