diff -r 902cb8d2053c -r 51b1ba3776b1 Makefile --- a/Makefile Fri Sep 16 09:14:59 2011 +0200 +++ b/Makefile Fri Sep 16 09:59:20 2011 +0200 @@ -1,14 +1,14 @@ CC = gcc -BUILDDIR = build -OBJ = ${BUILDDIR}/cline.o ${BUILDDIR}/scanner.o ${BUILDDIR}/settings.o ${BUILDDIR}/suffix_fnc.o ${BUILDDIR}/suffix_list.o ${BUILDDIR}/arguments.o +BUILDDIR = build/ +OBJ = $(shell ls | grep \.c | sed 's/^\([^.]*\)\.c/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ') BIN = ${BUILDDIR}/cline all: ${OBJ} ${CC} -o ${BIN} ${OBJ} -${BUILDDIR}/%.o: %.c +${BUILDDIR}%.o: %.c mkdir -p ${BUILDDIR} - ${CC} -c -std=c99 -o ${BUILDDIR}/$*.o $< + ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $< clean: rm build/*