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