mirror of
https://github.com/tat3r/tdfiglet.git
synced 2024-12-22 22:56:40 +00:00
33 lines
699 B
Makefile
33 lines
699 B
Makefile
PROG := tdfiglet
|
|
SRC := tdfiglet.c
|
|
PREFIX ?= /usr/local
|
|
FONTS := fonts/*
|
|
FONTDIR := $(PREFIX)/share/$(PROG)/fonts
|
|
CC ?= cc
|
|
CFLAGS += -DFONT_DIR=\"$(FONTDIR)\" -std=c99 -Wall -g
|
|
|
|
UNAME := $(shell sh -c 'uname -s 2>/dev/null')
|
|
|
|
ifeq ($(UNAME),Darwin)
|
|
CFLAGS += -Wunused-result -Wunused-value
|
|
LDFLAGS += -liconv
|
|
endif
|
|
|
|
default: $(SRC)
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
|
|
|
|
.PHONY: debug clean install
|
|
|
|
install:
|
|
test -d $(PREFIX)/bin || mkdir -p $(PREFIX)/bin
|
|
cp $(PROG) $(PREFIX)/bin
|
|
test -d $(FONTDIR) || mkdir -p $(FONTDIR)
|
|
for i in $(FONTS) ; do cp -v $$i $(FONTDIR) ; done
|
|
|
|
debug: $(SRC)
|
|
$(CC) -DDEBUG -g $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
|
|
|
|
clean:
|
|
rm -rf $(PROG) $(PROG).dSYM
|
|
|