diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-01-14 12:18:28 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-01-14 12:50:54 +0100 |
| commit | 6f53d329beca478d60f6e575918d73eb9cf1214f (patch) | |
| tree | 235b4958c92a1c151e7a36a01dda3500b2d01dcc | |
| parent | 1f6ddb7e602b234d58facac87b9c74fdad52ea62 (diff) | |
| download | vis-6f53d329beca478d60f6e575918d73eb9cf1214f.tar.gz vis-6f53d329beca478d60f6e575918d73eb9cf1214f.tar.xz | |
Simplify Makefile
Use $CC *.c -o vis to enable global link time optimization.
This also fixes issues with parallel builds.
config.h is no longer symlinked to config.def.h which allows
local modifications.
| -rw-r--r-- | Makefile | 34 |
1 files changed, 9 insertions, 25 deletions
@@ -1,32 +1,15 @@ include config.mk -SRC = editor.c window.c text.c text-motions.c text-objects.c register.c buffer.c ring-buffer.c -HDR := ${SRC:.c=.h} macro.h syntax.h util.h config.def.h -SRC += vis.c -OBJ = ${SRC:.c=.o} -ALL = ${SRC} ${HDR} config.mk Makefile LICENSE README vis.1 +ALL = *.c *.h config.mk Makefile LICENSE README vis.1 -all: clean options vis - -options: - @echo vis build options: - @echo "CFLAGS = ${CFLAGS}" - @echo "LDFLAGS = ${LDFLAGS}" - @echo "CC = ${CC}" +all: vis 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 + cp config.def.h config.h -vis: ${OBJ} - @echo CC -o $@ - @${CC} -o $@ ${OBJ} ${LDFLAGS} +vis: config.h config.mk + @echo ${CC} ${CFLAGS} ${LDFLAGS} *.c -o $@ + @${CC} ${CFLAGS} ${LDFLAGS} *.c -o $@ @ln -sf $@ nano debug: clean @@ -34,12 +17,13 @@ debug: clean clean: @echo cleaning - @rm -f vis nano ${OBJ} vis-${VERSION}.tar.gz + @rm -f vis nano vis-${VERSION}.tar.gz dist: clean @echo creating dist tarball @mkdir -p vis-${VERSION} @cp -R ${ALL} vis-${VERSION} + @rm -f vis-${VERSION}/config.h @tar -cf vis-${VERSION}.tar vis-${VERSION} @gzip vis-${VERSION}.tar @rm -rf vis-${VERSION} @@ -62,4 +46,4 @@ uninstall: @echo removing manual page from ${DESTDIR}${MANPREFIX}/man1 @rm -f ${DESTDIR}${MANPREFIX}/man1/vis.1 -.PHONY: all options clean dist install uninstall debug +.PHONY: all vis clean dist install uninstall debug |
