登录后台

页面导航

本文编写于 351 天前,最后修改于 351 天前,其中某些信息可能已经过时。
SOURCE += main

BUILDDIR = ./build

TARGET := main

INC += common.h

OBJ = ${addsuffix .o, ${SOURCE}}

CC := gcc
EXECFLAG += -o
CCFLAG += -c -g

all: ${TARGET}
    @echo All Done.

${TARGET}: ${OBJ}
    @${CC} ${addprefix ${BUILDDIR}/,${OBJ}} ${EXECFLAG} ${BUILDDIR}/${TARGET}
    @echo $@编译完成

${OBJ}:%.o: %.c %.h ${INC}
    @${CC} ${CCFLAG} $< -o ${BUILDDIR}/$@
    @echo $@编译完成

clean:
    @rm ${BUILDDIR}/*
    @echo 清理完成