no-more-secrets-rust/Makefile

60 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

# 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
2018-08-08 04:19:01 -07:00
CFLAGS ?= -Wextra -Wall -O2
.PHONY: all install uninstall clean
2023-08-12 02:35:26 -07:00
nms: $(OBJ)/error.o $(OBJ)/nmstermio.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN)
2023-07-23 03:03:23 -07:00
$(CC) $(CFLAGS) -o $(BIN)/$@ $^ target/release/libnmsrust.a
2023-11-12 11:43:23 -08:00
sneakers: $(OBJ)/nmstermio.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^ target/release/libnmsrust.a
all: nms sneakers
all-ncurses: nms-ncurses sneakers-ncurses
2023-08-12 02:35:26 -07:00
nms-ncurses: $(OBJ)/error.o $(OBJ)/nmstermio_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/nms.o | $(BIN)
2023-07-25 23:22:00 -07:00
$(CC) $(CFLAGS) -o $(BIN)/nms $^ -lncursesw target/release/libnmsrust.a
2023-11-12 11:43:23 -08:00
sneakers-ncurses: $(OBJ)/nmstermio_ncurses.o $(OBJ)/nmseffect.o $(OBJ)/sneakers.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/sneakers $^ -lncursesw target/release/libnmsrust.a
$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
$(CC) $(CFLAGS) -o $@ -c $<
$(BIN):
mkdir $(BIN)
$(OBJ):
mkdir $(OBJ)
clean:
rm -rf $(BIN)
rm -rf $(OBJ)
install:
2017-02-17 10:36:13 -08:00
install -d $(DESTDIR)$(mandir)/man6
install -m644 nms.6 sneakers.6 $(DESTDIR)$(mandir)/man6
2016-05-20 13:13:33 -07:00
install -d $(DESTDIR)$(bindir)
cd $(BIN) && install * $(DESTDIR)$(bindir)
uninstall:
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