Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add override directive to makefile #29

Merged
merged 2 commits into from Sep 1, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 12 additions & 7 deletions Makefile
@@ -1,8 +1,9 @@
OBJ=cv
CFLAGS+=-g -Wall -D_FILE_OFFSET_BITS=64
LFLAGS=-lncurses -lm
PREFIX = $(DESTDIR)/usr/local
OBJ = cv
override CFLAGS += -g -Wall -D_FILE_OFFSET_BITS=64
override LFLAGS += -lncurses -lm
PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1

$(OBJ) : cv.o sizes.o hlist.o
$(CC) -Wall $^ -o $@ $(LFLAGS)
Expand All @@ -11,7 +12,11 @@ $(OBJ) : cv.o sizes.o hlist.o
clean :
rm -f *.o $(OBJ)
install : $(OBJ)
@echo "Installing to $(BINDIR) ..."
@mkdir -p $(BINDIR)
@install -m 0755 $(OBJ) $(BINDIR)/$(TARGET) || \
@echo "Installing program to $(DESTDIR)$(BINDIR) ..."
@mkdir -p $(DESTDIR)$(BINDIR)
@install -pm0755 $(OBJ) $(DESTDIR)$(BINDIR)/$(TARGET) || \
echo "Failed. Try "make PREFIX=~ install" ?"
@echo "Installing manpage to $(DESTDIR)$(MANDIR) ..."
@mkdir -p $(DESTDIR)$(MANDIR)
@install -pm0644 cv.1 $(DESTDIR)$(MANDIR)/ || \
echo "Failed. Try "make PREFIX=~ install" ?"