no-more-secrets-rust/Makefile

49 lines
876 B
Makefile
Raw 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
CFLAGS ?= -Wextra -Wall
.PHONY: all install uninstall clean
EXES = nms sneakers
all: $(EXES)
nms: $(OBJ)/libnms.o $(OBJ)/main.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
sneakers: $(OBJ)/libnms.o $(OBJ)/sneakers.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
$(CC) $(CFLAGS) -o $@ -c $<
$(BIN):
mkdir $(BIN)
$(OBJ):
mkdir $(OBJ)
clean:
rm -rf $(BIN)
rm -rf $(OBJ)
install:
2016-05-20 13:13:33 -07:00
install -d $(DESTDIR)$(bindir)
cd $(BIN) && install $(EXES) $(DESTDIR)$(bindir)
uninstall:
2016-05-20 13:13:33 -07:00
for exe in $(EXES); do rm $(DESTDIR)$(bindir)/$$exe; done