tdfiglet/Makefile

37 lines
844 B
Makefile
Raw Permalink Normal View History

2018-06-22 23:44:33 -07:00
PROG := tdfiglet
SRC := tdfiglet.c
2018-07-14 13:58:08 -07:00
PREFIX ?= /usr/local
FONTS := fonts/*
FONTDIR := $(PREFIX)/share/$(PROG)/fonts
2018-06-24 18:41:42 -07:00
CC ?= cc
CFLAGS += -DFONT_DIR=\"$(FONTDIR)\" -std=c99 -Wall
DFLAGS = -g
2018-06-22 23:44:33 -07:00
UNAME := $(shell sh -c 'uname -s 2>/dev/null')
ifeq ($(UNAME), Darwin)
CC = clang
2018-06-22 23:44:33 -07:00
CFLAGS += -Wunused-result -Wunused-value
DLAGS += -fsanitize=address -fsanitize=undefined -fsanitize=leak
2018-06-22 23:44:33 -07:00
LDFLAGS += -liconv
endif
default: $(SRC)
$(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
2018-07-14 13:58:08 -07:00
.PHONY: debug clean install
install:
2018-08-06 14:28:19 -07:00
test -d $(FONTDIR) || mkdir -p $(PREFIX)/bin
cp $(PROG) $(PREFIX)/bin
test -d $(FONTDIR) || mkdir -p $(FONTDIR)
rm -f $(FONTDIR)/*.tdf
2018-08-06 14:28:19 -07:00
for i in $(FONTS) ; do cp -v $$i $(FONTDIR) ; done
chmod ugo+r $(FONTDIR)/*.tdf
2018-06-22 23:44:33 -07:00
debug: $(SRC)
$(CC) -DDEBUG $(CFLAGS) $(DFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
2018-06-22 23:44:33 -07:00
clean:
rm -rf $(PROG) $(PROG).dSYM
2018-07-14 13:58:08 -07:00