NAME=fuel EXE_PATH=exe EXE=${EXE_PATH}/${NAME}.out INCLUDE_PATH=include CC=gcc CFLAGS=-c -I ${INCLUDE_PATH} -std=c11 LLIBS= SRC_PATH=. SRC=$(wildcard ${SRC_PATH}/*.c) OBJ_PATH=obj OBJ=$(addprefix ${OBJ_PATH}/, $(notdir $(SRC:.c=.o))) all: $(EXE) dirs: mkdir -p ${EXE_PATH} ${INCLUDE_PATH} ${OBJ_PATH} ${SRC_PATH} ${EXE}: $(OBJ) $(CC) -o $@ $^ ${LLIBS} ln -fs $@ ${NAME} ${OBJ_PATH}/%.o: ${SRC_PATH}/%.c ${INCLUDE_PATH}/%.h echo "compiling: $@" $(CC) ${CFLAGS} -o $@ $< clean: rm -rf ${EXE} ${OBJ}