diff options
author | Quentin Rameau <quinq@fifth.space> | 2019-07-24 17:50:05 +0200 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2019-07-24 22:50:57 +0100 |
commit | 54eae9246240d2f364e2e3cb09cef9ebdbdd94b1 (patch) | |
tree | 2d88376616ed3b2641c0e29950cec3214ed86dd3 | |
parent | 1aa7efdd7a8dcfd1a55f30c2754d1e473f0bb59b (diff) |
Rework the Makefile a little
Ensure it's portable
Get rid of NAME macro
Replace build target with a simple dependency target
Add clean target
-rw-r--r-- | Makefile | 31 | ||||
-rw-r--r-- | config.mk | 11 |
2 files changed, 21 insertions, 21 deletions
@@ -1,36 +1,41 @@ # gramscii - simple editor for ASCII box-and-arrow charts +.POSIX: include config.mk SRC = gramscii.c -INCLUDES = config.h +INC = config.h all: options gramscii options: @echo "-+- build options -+-" - @echo "PREFIX = $(PREFIX)" - @echo "CFLAGS = $(CFLAGS)" - @echo "CC = $(CC)" + @echo "PREFIX = $(PREFIX)" + @echo "CFLAGS = $(CFLAGS)" + @echo "LDFLAGS = $(LDFLAGS)" + @echo "CC = $(CC)" @echo "-+-+-+-+-+-+-+-+-+-+-" -gramscii: $(SRC) $(INCLUDES) - $(CC) $(CFLAGS) -o $@ $(SRC) +gramscii: ${INC} + +clean: + @echo cleaning + @rm -f $(SRC:.c=) install: all @echo installing executable to ${DESTDIR}${BINDIR} @mkdir -p "${DESTDIR}${BINDIR}" - @cp -f ${NAME} "${DESTDIR}${BINDIR}" - @chmod 755 "${DESTDIR}${BINDIR}/${NAME}" + @cp -f gramscii "${DESTDIR}${BINDIR}" + @chmod 755 "${DESTDIR}${BINDIR}/gramscii" @echo installing manpage to "${DESTDIR}${MANDIR}/man1" @mkdir -p "${DESTDIR}${MANDIR}/man1" - @cp -f ${NAME}.1 "${DESTDIR}${MANDIR}/man1" - @chmod 644 "${DESTDIR}${MANDIR}/man1/${NAME}.1" + @cp -f gramscii.1 "${DESTDIR}${MANDIR}/man1" + @chmod 644 "${DESTDIR}${MANDIR}/man1/gramscii.1" uninstall: @echo removing executable file from ${DESTDIR}${BINDIR} - @rm -f "${DESTDIR}${BINDIR}/${NAME}" - @echo removing manpage from "${DESTDIR}${MANDIR}" - @rm -f "${DESTDIR}${MANDIR}/man1/${NAME}.1" + @rm -f "${DESTDIR}${BINDIR}/gramscii" + @echo removing manpage from "${DESTDIR}${MANDIR}/man1" + @rm -f "${DESTDIR}${MANDIR}/man1/gramscii.1" @@ -1,10 +1,5 @@ -NAME=gramscii -VERSION=0.1 - PREFIX = /usr/local -BINDIR = $(PREFIX)/bin -MANDIR = $(PREFIX)/share/man - -CFLAGS=-O3 -std=c90 -pedantic -Wall +BINDIR = ${PREFIX}/bin +MANDIR = ${PREFIX}/share/man -CC=cc +CFLAGS = -O3 -std=c90 -pedantic -Wall |