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
|
|
|
|
CFLAGS ?= -Wextra -Wall
|
2016-04-15 11:02:09 -07:00
|
|
|
|
2016-05-01 12:30:50 -07:00
|
|
|
.PHONY: all install uninstall clean
|
|
|
|
|
2017-01-16 13:28:12 -08:00
|
|
|
nms: $(OBJ)/nms.o $(OBJ)/main.o | $(BIN)
|
2017-01-08 14:22:03 -08:00
|
|
|
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
|
2016-04-19 15:18:02 -07:00
|
|
|
|
2017-01-16 13:28:12 -08:00
|
|
|
sneakers: $(OBJ)/nms.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 19:00:24 -08:00
|
|
|
nms-ncurses: $(OBJ)/nms-ncurses.o $(OBJ)/main.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-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:
|
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;
|