diff options
author | Tomasz Kramkowski <tk@the-tk.com> | 2018-03-28 00:09:21 +0100 |
---|---|---|
committer | Tomasz Kramkowski <tk@the-tk.com> | 2018-03-28 00:11:22 +0100 |
commit | 933cf4f0a47306ee4b0c1ac728173a576cc2ebe1 (patch) | |
tree | 6fd7446f4bc2a230d3d5bc24eae0dde4a6eefbbc /Makefile | |
download | bie-master.tar.gz bie-master.tar.xz bie-master.zip |
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..982352c --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +# Copyright (C) 2018 Tomasz Kramkowski <tk@the-tk.com> +# SPDX-License-Identifier: MIT +-include config.mk + +PROG := bie +MANPAGE := $(PROG).1 +VERSION != git describe --tags 2>/dev/null || echo "v0.1" + +EPRINTF_PATH ?= ../eprintf +PKG_CONFIG ?= pkg-config +LN ?= ln -sf + +CPPFLAGS += -DVERSION=\"$(VERSION)\" +CFLAGS += -std=c11 -MMD -MP + +OBJ := bie.o eprintf.o +DEP := $(OBJ:.o=.d) + +prefix ?= /usr/local +exec_prefix ?= $(prefix) +bindir = $(exec_prefix)/bin +datarootdir = $(prefix)/share +mandir = $(datarootdir)/man +man1dir = $(mandir)/man1 + +all: $(PROG) $(MANPAGE) +$(PROG): $(OBJ) +bie.o: eprintf.h +$(MANPAGE): $(MANPAGE).in + m4 -DVERSION=$(VERSION) $^ >$@ + +install: $(PROG) $(MANPAGE) + install -Dm755 -s $(PROG) -t $(DESTDIR)$(bindir) + install -Dm644 $(MANPAGE) -t $(DESTDIR)$(man1dir) + +clean: + $(RM) $(OBJ) $(DEP) $(PROG) $(MANPAGE) + +include $(EPRINTF_PATH)/module.mk + +-include $(DEP) + +.PHONY: all install clean |