forked from tat3r/tdfiglet
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (31 loc) · 938 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
PROG := tdfiglet
SRC := tdfiglet.c
PREFIX ?= /usr/local
FONTS := fonts/*
FONTDIR := $(PREFIX)/share/$(PROG)/fonts
CC ?= cc
CFLAGS += -DFONT_DIR=\"$(FONTDIR)\" -std=c99 -Wall
DFLAGS = -g
UNAME := $(shell sh -c 'uname -s 2>/dev/null')
ifeq ($(UNAME), Darwin)
CC = clang
CFLAGS += -Wunused-result -Wunused-value
DLAGS += -fsanitize=address -fsanitize=undefined -fsanitize=leak
LDFLAGS += -liconv
endif
default: $(SRC)
$(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
.PHONY: debug clean install test
install:
test -d $(PREFIX)/bin || mkdir -p $(PREFIX)/bin
cp $(PROG) $(PREFIX)/bin
test -d $(FONTDIR) || mkdir -p $(FONTDIR)
rm -f $(FONTDIR)/*.tdf
for i in $(FONTS) ; do cp -v $$i $(FONTDIR) ; done
chmod ugo+r $(FONTDIR)/*.tdf
debug: $(SRC)
$(CC) -DDEBUG $(CFLAGS) $(DFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
clean:
rm -rf $(PROG) $(PROG).dSYM
test: $(PROG)
for i in fonts/*.tdf; do ./tdfiglet -i -f $$i -jc Test; done | less -R