From 933cf4f0a47306ee4b0c1ac728173a576cc2ebe1 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Wed, 28 Mar 2018 00:09:21 +0100 Subject: bie: initial commit and version 0.1 --- Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Makefile (limited to 'Makefile') 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 +# 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 -- cgit v1.2.3-54-g00ecf