/*
*Author : DavidLin
*Date : 2014-12-10pm
*Email : [email protected] or [email protected]
*world : the city of SZ, in China
*Ver : 000.000.001
*history : editor time do
* 1)LinPeng 2014-12-10 created this file!
* 2)
*/ #**********************************************
# filename : Makefile
# cmd list :
# make
# make debug/d
# make asm/a
# make clean/c
#********************************************** .PHONY: all clean
CC = gcc
RM = rm
SUDO = sudo
DUMP = objdump LIB = -lpthread SRCS = $(wildcard *.c)
OBJS =
EXES = $(patsubst %.c, %, $(SRCS))
EXEC = $(addprefix ./, $(EXES))
EXEC := $(strip $(EXEC))
LOGS = $(addsuffix .S, $(EXEC)) all:
$(CC) -o $(EXES) $(SRCS) $(LIB)
debug d:
$(SUDO) $(EXEC)
asm a:
$(DUMP) -S $(EXES) > $(LOGS)
clean c:
$(RM) -fr $(OBJS) $(EXES) $(LOGS)
可用于例如以下链接code的Makefile
协议:怎样实现一个最简单的通信协议(线程模拟)