tdfiglet/Makefile

33 lines
700 B
Makefile
Raw Permalink Normal View History

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-07-14 20:58:08 +00:00
CFLAGS += -DFONT_DIR=\"$(FONTDIR)\" -std=c99 -Wall
2018-06-23 06:44:33 +00:00
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)
2018-07-14 20:58:08 +00:00
.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
2018-06-23 06:44:33 +00:00
debug: $(SRC)
$(CC) -DDEBUG -g $(CFLAGS) $(LDFLAGS) $(SRC) -o $(PROG)
clean:
rm -rf $(PROG) $(PROG).dSYM
2018-07-14 20:58:08 +00:00