refactor configure script

Generate a makefile config instead of a makefile with predefined
constants. This makes the build a bit more easier to modify. Also
improve the makefile and apply some suggestions from shellcheck. :)
This commit is contained in:
Jeremy Baxter 2024-02-28 16:18:06 +13:00
parent 4bb8d391fd
commit f1b79c2a7c
3 changed files with 60 additions and 66 deletions

29
Makefile Normal file
View file

@ -0,0 +1,29 @@
IMPORT = import
PREFIX = /usr/local
MANPREFIX = ${PREFIX}/man
DC = ${_DC}
CFLAGS = ${_CFLAGS}
OBJS = ${_OBJS}
all: esv
include config.mk
esv: ${OBJS}
${DC} ${_LDFLAGS} -of=$@ ${OBJS}
.SUFFIXES: .d .o
.d.o:
${DC} ${CFLAGS} -c $<
clean:
rm -f esv ${OBJS} ${INIOBJS}
install: esv
install -Dm755 esv ${DESTDIR}${PREFIX}/bin/esv
install -Dm644 esv.1 ${DESTDIR}${MANPREFIX}/man1
install -Dm644 esv.conf.5 ${DESTDIR}${MANPREFIX}/man5
.PHONY: all clean install