SHELL = /bin/bash
-PREFIX = /usr
-DESTDIR = $(PREFIX)/bin
+DESTDIR =
+PREFIX = $(DESTDIR)/usr
+BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man/man1
PROG = odot
OBJECTS = $(PROG).o database.o actions.o function.o sqlite3.o
LDFLAGS = -L .
LDLIBS = -lpthread
-CFLAGS = -O2 -v
+CFLAGS = -O2
WARNINGS = -Werror -Wall -Wextra -Wpedantic -Wno-unused
CPPFLAGS = -I .
ALL_CFLAGS = $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LDLIBS) $(WARNINGS)
install: $(CFILE) $(HEADER) sqlite3.c
$(CC) $(CFILE) sqlite3.c $(ALL_CFLAGS) -o $(PROG)
- install -CDTm 755 $(PROG) $(DESTDIR)/$(PROG)
+ install -CDTm 755 $(PROG) $(BINDIR)/$(PROG)
+ gzip -cf $(PROG).1 > $(PROG).1.gz
install -CDTm 644 $(PROG).1.gz $(MANDIR)/$(PROG).1
debug: $(CFILE)
clean:
[[ -f $(PROG) ]] && rm $(PROG)
- [[ -f $(DESTDIR)/$(PROG) ]] && sudo rm $(DESTDIR)/$(PROG)
+ [[ -f $(DESTDIR)/$(PROG) ]] && sudo rm $(BINDIR)/$(PROG)
dbclean:
rm *.db