2016-05-01 12:30:50 -07:00
|
|
|
# Installation directories following GNU conventions
|
2016-09-18 20:33:29 -07:00
|
|
|
prefix ?= /usr/local
|
2016-05-01 12:30:50 -07:00
|
|
|
exec_prefix = $(prefix)
|
|
|
|
bindir = $(exec_prefix)/bin
|
|
|
|
sbindir = $(exec_prefix)/sbin
|
|
|
|
datarootdir = $(prefix)/share
|
|
|
|
datadir = $(datarootdir)
|
|
|
|
includedir = $(prefix)/include
|
|
|
|
mandir = $(datarootdir)/man
|
|
|
|
|
2016-04-15 11:02:09 -07:00
|
|
|
BIN=bin
|
|
|
|
OBJ=obj
|
|
|
|
SRC=src
|
|
|
|
|
2016-09-18 20:33:29 -07:00
|
|
|
CC ?= gcc
|
2018-08-08 04:19:01 -07:00
|
|
|
CFLAGS ?= -Wextra -Wall -O2
|
2016-04-15 11:02:09 -07:00
|
|
|
|
2016-05-01 12:30:50 -07:00
|
|
|
.PHONY: all install uninstall clean
|
|
|
|
|
2017-01-19 09:08:20 -08:00
|
|
|
nms: $(OBJ)/nmscharset.o $(OBJ)/nmstermio.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN)
|
2017-01-08 14:22:03 -08:00
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
|
2016-04-19 15:18:02 -07:00
|
|
|
|
2017-01-19 09:08:20 -08:00
|
|
|
sneakers: $(OBJ)/nmscharset.o $(OBJ)/nmstermio.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN)
|
2017-01-08 14:22:03 -08:00
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
|
2016-04-15 11:02:09 -07:00
|
|
|
|
2017-01-17 16:30:24 -08:00
|
|
|
all: nms sneakers
|
|
|
|
|
2017-01-17 21:16:45 -08:00
|
|
|
all-ncurses: nms-ncurses sneakers-ncurses
|
|
|
|
|
2017-01-19 09:08:20 -08:00
|
|
|
nms-ncurses: $(OBJ)/nmscharset.o $(OBJ)/nmstermio_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN)
|
2017-01-17 19:08:48 -08:00
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/nms $^ -lncurses
|
2017-01-17 19:00:24 -08:00
|
|
|
|
2017-01-19 09:08:20 -08:00
|
|
|
sneakers-ncurses: $(OBJ)/nmscharset.o $(OBJ)/nmstermio_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN)
|
2017-01-17 21:14:21 -08:00
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/sneakers $^ -lncurses
|
|
|
|
|
2017-01-08 14:22:03 -08:00
|
|
|
$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
|
2016-04-27 21:51:47 -07:00
|
|
|
$(CC) $(CFLAGS) -o $@ -c $<
|
2016-04-19 15:18:02 -07:00
|
|
|
|
2016-04-27 21:51:47 -07:00
|
|
|
$(BIN):
|
|
|
|
mkdir $(BIN)
|
|
|
|
|
|
|
|
$(OBJ):
|
|
|
|
mkdir $(OBJ)
|
|
|
|
|
2016-04-15 11:02:09 -07:00
|
|
|
clean:
|
2016-04-27 21:51:47 -07:00
|
|
|
rm -rf $(BIN)
|
|
|
|
rm -rf $(OBJ)
|
2016-05-01 12:30:50 -07:00
|
|
|
|
|
|
|
install:
|
2017-02-17 10:36:13 -08:00
|
|
|
install -d $(DESTDIR)$(mandir)/man6
|
2017-02-19 08:54:14 -08:00
|
|
|
install -m644 nms.6 sneakers.6 $(DESTDIR)$(mandir)/man6
|
2016-05-20 13:13:33 -07:00
|
|
|
install -d $(DESTDIR)$(bindir)
|
2017-01-17 16:30:24 -08:00
|
|
|
cd $(BIN) && install * $(DESTDIR)$(bindir)
|
2016-05-01 12:30:50 -07:00
|
|
|
|
|
|
|
uninstall:
|
2017-01-17 16:39:16 -08:00
|
|
|
rm -f $(DESTDIR)$(bindir)/nms;
|
|
|
|
rm -f $(DESTDIR)$(bindir)/sneakers;
|
2017-02-17 10:36:13 -08:00
|
|
|
rm -f $(DESTDIR)$(mandir)/man6/nms.6
|
|
|
|
rm -f $(DESTDIR)$(mandir)/man6/sneakers.6
|