From 8496e64dc53b1a76ac23e6a22edd40abe4316c5c Mon Sep 17 00:00:00 2001 From: tater Date: Sat, 14 Jul 2018 16:58:08 -0400 Subject: [PATCH] added install target --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 1a41f7e..283b780 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ PROG := tdfiglet SRC := tdfiglet.c +PREFIX ?= /usr/local +FONTS := fonts/* +FONTDIR := $(PREFIX)/share/$(PROG)/fonts CC ?= cc -CFLAGS += -std=c99 -Wall +CFLAGS += -DFONT_DIR=\"$(FONTDIR)\" -std=c99 -Wall UNAME := $(shell sh -c 'uname -s 2>/dev/null') @@ -13,10 +16,17 @@ endif default: $(SRC) $(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG) -.PHONY: debug clean +.PHONY: debug clean install + +install: + install -m 0755 -d $(PREFIX)/bin + install -m 0755 -d $(FONTDIR) + install -m 0755 $(PROG) $(PREFIX)/bin/$(PROG) + for i in $(FONTS) ; do install -m 0644 $$i $(FONTDIR) ; done debug: $(SRC) $(CC) -DDEBUG -g $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG) clean: rm -rf $(PROG) $(PROG).dSYM +