no-more-secrets-rust/Makefile
Brian Barto 5fd104afee Change file names and update function names (to align with file name changes)
modified:   Makefile
	renamed:    src/main.c -> src/nms.c
	deleted:    src/nms.h
	renamed:    src/nms.c -> src/nmseffect.c
	new file:   src/nmseffect.h
	modified:   src/sneakers.c
2017-01-19 11:17:40 -05:00

56 lines
1.2 KiB
Makefile

# Installation directories following GNU conventions
prefix ?= /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
sbindir = $(exec_prefix)/sbin
datarootdir = $(prefix)/share
datadir = $(datarootdir)
includedir = $(prefix)/include
mandir = $(datarootdir)/man
BIN=bin
OBJ=obj
SRC=src
CC ?= gcc
CFLAGS ?= -Wextra -Wall
.PHONY: all install uninstall clean
nms: $(OBJ)/nmsterm.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
sneakers: $(OBJ)/nmsterm.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
all: nms sneakers
all-ncurses: nms-ncurses sneakers-ncurses
nms-ncurses: $(OBJ)/nmsterm_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/nms $^ -lncurses
sneakers-ncurses: $(OBJ)/nmsterm_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/sneakers $^ -lncurses
$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
$(CC) $(CFLAGS) -o $@ -c $<
$(BIN):
mkdir $(BIN)
$(OBJ):
mkdir $(OBJ)
clean:
rm -rf $(BIN)
rm -rf $(OBJ)
install:
install -d $(DESTDIR)$(bindir)
cd $(BIN) && install * $(DESTDIR)$(bindir)
uninstall:
rm -f $(DESTDIR)$(bindir)/nms;
rm -f $(DESTDIR)$(bindir)/sneakers;