# common makefile header
#
# -Wl: 使用gcc命令时告知要使用到链接器
# uuid: 使用libuuid需要先安装uuid开发包
#DIR_INC := -I ./include
DIR_INC := -I ./include/fastdfs
DIR_INC += -I ./include/fastcommon
DIR_INC += -I ./util/include
#DIR_LIB := -Wl,-Bdynamic
DIR_LIB := -L ./lib -lfastcommon
DIR_LIB += -lfdfsclient
DIR_LIB += -lpthread
DIR_LIB += -lrt
DIR_LIB += -lz
DIR_LIB += -lm
OBJS := ./app/main.o
OBJS += ./util/src/fdfs_file.o
CFLAGS = -Wall -g
TARGET = fastdfs
%.o:%.c
$(CC) $(CFLAGS) $(DIR_INC) $< -o $@ -c
$(TARGET):$(OBJS)
$(CC) $(CFLAGS) $(OBJS) $(DIR_LIB) -o bin/$(TARGET)
#sudo chown root bin/$(TARGET)
#sudo chmod u+s bin/$(TARGET)
clean:
$(RM) $(OBJS) bin/$(TARGET)
# common makefile foot