Dont make sneakers by default. user must specify 'make sneakers' or 'make all'

modified:   Makefile
This commit is contained in:
Brian Barto 2017-01-17 19:30:24 -05:00
parent 1c65c9a218
commit 79cfbf0b71

View File

@ -17,15 +17,14 @@ CFLAGS ?= -Wextra -Wall
.PHONY: all install uninstall clean
EXES = nms sneakers
all: $(EXES)
nms: $(OBJ)/nms.o $(OBJ)/main.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
sneakers: $(OBJ)/nms.o $(OBJ)/sneakers.o | $(BIN)
$(CC) $(CFLAGS) -o $(BIN)/$@ $^
all: nms sneakers
$(OBJ)/%.o: $(SRC)/%.c | $(OBJ)
$(CC) $(CFLAGS) -o $@ -c $<
@ -41,8 +40,8 @@ clean:
install:
install -d $(DESTDIR)$(bindir)
cd $(BIN) && install $(EXES) $(DESTDIR)$(bindir)
cd $(BIN) && install * $(DESTDIR)$(bindir)
uninstall:
for exe in $(EXES); do rm $(DESTDIR)$(bindir)/$$exe; done
if [ -f $(DESTDIR)$(bindir)/nms ]; then rm $(DESTDIR)$(bindir)/nms; fi;
if [ -f $(DESTDIR)$(bindir)/sneakers ]; then rm $(DESTDIR)$(bindir)/sneakers; fi;