SHELL = /bin/bash
-DESTDIR ?=
+DESTDIR ?=
ETCDIR ?= $(DESTDIR)/etc/$(NAME)
USRDIR ?= $(DESTDIR)/usr
BUILD ?= ./build
BIN ?= $(BUILD)/$(NAME)
-SRC ?= $(wildcard $(SRCDIR)/*.c)
+SRC ?= $(wildcard $(SRCDIR)/*.c)
HDR ?= $(wildcard $(SRCDIR)/*.h)
OBJ ?= $(patsubst $(SRCDIR)/%.c, $(OBJDIR)/%.o, $(SRC))
LIBNAME ?= lib$(NAME)
MANPAGE ?= $(patsubst $(SRCDIR)/%.1,$(BUILD)/%.1.gz,$(MAN))
DOC ?= README LICENSE
-CC = gcc
-AR = ar
-LD = ld
ZIP = gzip
RM = rm -f
cp $(MANPAGE) $(MANDIR)
chmod 644 $(MANDIR)/$(patsubst $(BUILD)/%,%,$(MANPAGE))
-mkdir -p $(DOCDIR)
- install -CDm 644 -t $(DOCDIR) $(DOC)
+ install -CDm 644 -t $(DOCDIR) $(DOC)
install_lib:
-mkdir -p $(LIBDIR)
chmod 644 $(INCLUDE)/$(patsubst $(SRCDIR)/%,%,$(HDR))
uninstall:
- $(RM) -r $(BINDIR)/$(patsubst $(BUILD)/%,%,$(BIN))
- $(RM) -r $(MANDIR)/$(patsubst $(BUILD)/%,%,$(MANPAGE))
+ $(RM) -r $(BINDIR)/$(patsubst $(BUILD)/%,%,$(BIN))
+ $(RM) -r $(MANDIR)/$(patsubst $(BUILD)/%,%,$(MANPAGE))
$(RM) -r $(INCLUDE)/$(patsubst $(SRC)/%,%,$(HDR))
$(RM) -r $(LIBDIR)/$(patsubst $(BUILD)/%,%,$(LIB))
$(RM) -r $(LIBDIR)/$(patsubst $(BUILD)/%,%,$(STATIC))
mkdir $@
.PHONY: all release lib install_lib static install_static tar clean install uninstall debug
-