Makefile

changeset 13
51b1ba3776b1
parent 10
ecf787666f44
child 14
ee9333c91dda
equal deleted inserted replaced
12:902cb8d2053c 13:51b1ba3776b1
1 CC = gcc 1 CC = gcc
2 BUILDDIR = build 2 BUILDDIR = build/
3 OBJ = ${BUILDDIR}/cline.o ${BUILDDIR}/scanner.o ${BUILDDIR}/settings.o ${BUILDDIR}/suffix_fnc.o ${BUILDDIR}/suffix_list.o ${BUILDDIR}/arguments.o 3 OBJ = $(shell ls | grep \.c | sed 's/^\([^.]*\)\.c/${BUILDDIR:/=\/}\1.o/g' | tr '\n' ' ')
4 BIN = ${BUILDDIR}/cline 4 BIN = ${BUILDDIR}/cline
5 5
6 all: ${OBJ} 6 all: ${OBJ}
7 ${CC} -o ${BIN} ${OBJ} 7 ${CC} -o ${BIN} ${OBJ}
8 8
9 ${BUILDDIR}/%.o: %.c 9 ${BUILDDIR}%.o: %.c
10 mkdir -p ${BUILDDIR} 10 mkdir -p ${BUILDDIR}
11 ${CC} -c -std=c99 -o ${BUILDDIR}/$*.o $< 11 ${CC} -c -std=c99 -o ${BUILDDIR}$*.o $<
12 12
13 clean: 13 clean:
14 rm build/* 14 rm build/*

mercurial