From bc0f09dce9fb9420ea1d5c10ebfacf50916b10af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 24 Aug 2014 10:04:28 +0200 Subject: Add work in progress editor frontend --- Makefile | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2bcc82e --- /dev/null +++ b/Makefile @@ -0,0 +1,63 @@ +include config.mk + +SRC += vis.c colors.c editor.c text.c +OBJ = ${SRC:.c=.o} + +all: clean options vis + +options: + @echo vis build options: + @echo "CFLAGS = ${CFLAGS}" + @echo "LDFLAGS = ${LDFLAGS}" + @echo "CC = ${CC}" + +config.h: +#TODO cp config.def.h config.h + ln -fs config.def.h config.h + +.c.o: + @echo CC $< + @${CC} -c ${CFLAGS} $< + +${OBJ}: config.h config.mk + +vis: ${OBJ} + @echo CC -o $@ + @${CC} -o $@ ${OBJ} ${LDFLAGS} + @ln -sf $@ nano + +debug: clean + @make CFLAGS='${DEBUG_CFLAGS}' + +clean: + @echo cleaning + @rm -f vis nano ${OBJ} vis-${VERSION}.tar.gz + +dist: clean + @echo creating dist tarball + @mkdir -p vis-${VERSION} + @cp -R LICENSE Makefile README config.def.h config.mk \ + ${SRC} editor.h text.h util.h vis.1 vis-${VERSION} + @tar -cf vis-${VERSION}.tar vis-${VERSION} + @gzip vis-${VERSION}.tar + @rm -rf vis-${VERSION} + +install: vis + @echo stripping executable + @strip -s vis + @echo installing executable file to ${DESTDIR}${PREFIX}/bin + @mkdir -p ${DESTDIR}${PREFIX}/bin + @cp -f vis ${DESTDIR}${PREFIX}/bin + @chmod 755 ${DESTDIR}${PREFIX}/bin/vis + @echo installing manual page to ${DESTDIR}${MANPREFIX}/man1 + @mkdir -p ${DESTDIR}${MANPREFIX}/man1 + @sed "s/VERSION/${VERSION}/g" < vis.1 > ${DESTDIR}${MANPREFIX}/man1/vis.1 + @chmod 644 ${DESTDIR}${MANPREFIX}/man1/vis.1 + +uninstall: + @echo removing executable file from ${DESTDIR}${PREFIX}/bin + @rm -f ${DESTDIR}${PREFIX}/bin/vis + @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 + @rm -f ${DESTDIR}${MANPREFIX}/man1/vis.1 + +.PHONY: all options clean dist install uninstall debug -- cgit v1.2.3