点击(此处)折叠或打开
- #
- DIR_INC = ./include
- DIR_SRC = ./src
- DIR_OBJ = ./obj
- DIR_BIN = ./bin
- DIR_LIB = ./lib
- SRC = $(wildcard ${DIR_SRC}/*.c)
- OBJ = $(patsubst %.c,${DIR_OBJ}/%.o,$(notdir ${SRC}))
- TARGET = unit_test
- BIN_TARGET = ${DIR_BIN}/${TARGET}
- CC = arm-linux-gcc
- CFLAGS = -g -Wall -I${DIR_INC}
- LDFLAGS = -L${DIR_LIB}
- ${BIN_TARGET}:${OBJ}
- $(CC) $(LDFLAGS) $(OBJ) -o $@
- ${DIR_OBJ}/%.o:${DIR_SRC}/%.c
- $(CC) $(CFLAGS) -c $< -o $@
- .PHONY:clean
- clean:
- find ${DIR_OBJ} -name *.o -exec rm -rf {} \