added install target

This commit is contained in:
tater 2018-07-14 16:58:08 -04:00
parent 54abc1114b
commit 8496e64dc5

View File

@ -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