Skip to content

Commit

Permalink
Makefile: Use proper PREFIX/DESTDIR.
Browse files Browse the repository at this point in the history
  • Loading branch information
vifino committed Apr 27, 2019
1 parent 2045b6f commit 86b480a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,20 @@ CC ?= cc
CFLAGS ?= -Os
CPPFLAGS += -pedantic -Wall -Wextra #-fsanitize=address,undefined

DESTDIR ?= /usr/local
PREFIX ?= /usr/local
DESTDIR ?= /

BINS=ff-notext
all: $(BINS)

ff-notext: ff-notext.c
$(CC) $(CPPFLAGS) $(CFLAGS) $(shell pkg-config --cflags --libs tesseract) $(LDFLAGS) -o ff-notext $^
$(CC) $(CPPFLAGS) $(CFLAGS) $(shell pkg-config --cflags --libs tesseract-ocr) $(LDFLAGS) -o ff-notext $^

install: $(BINS)
install $(BINS) $(DESTDIR)/bin
install $(BINS) $(DESTDIR)/$(PREFIX)/bin

uninstall:
cd $(DESTDIR)/$(PREFIX)/bin && rm $(BINS)

clean:
rm -f $(BINS) *.o

0 comments on commit 86b480a

Please sign in to comment.