1 Star 0 Fork 12

xiaoyinshu/protothreads

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 2.31 KB
一键复制 编辑 原始数据 按行查看 历史
kalimdorsummer 提交于 2020-10-07 14:15 . version: v0.80
CC = gcc
target = ./bin/Debug/all_test
OBJDIR = obj
CFLAGS = -m32 -g -Wall
ifeq ($(PLATFORM),win)
LFLAGS = -m32 -g
LINK_LIB = C:\MinGW\lib\libwinmm.a
else
LFLAGS = -m32 -g -lpthread
endif
INC = -I./protothreads
INC += -I./protothreads/components
INC += -I./protothreads/drivers
ifeq ($(PLATFORM),win)
else
INC += -I./mult_timer
endif
source = $(wildcard *.c)
vpath %.c aaa_sec_fringe
source += $(notdir $(wildcard aaa_sec_fringe/*.c))
ifeq ($(PLATFORM),win)
else
vpath %.c mult_timer
source += $(notdir $(wildcard mult_timer/*.c))
endif
vpath %.c array_func_add_test
source += $(notdir $(wildcard array_func_add_test/*.c))
vpath %.c hello
source += $(notdir $(wildcard hello/*.c))
vpath %.c overflow_test
source += $(notdir $(wildcard overflow_test/*.c))
vpath %.c protothreads
source += $(notdir $(wildcard protothreads/*.c))
vpath %.c protothreads/components
source += $(notdir $(wildcard protothreads/components/*.c))
vpath %.c protothreads/drivers
source += $(notdir $(wildcard protothreads/drivers/*.c))
vpath %.c pt_god_schedule_test
source += $(notdir $(wildcard pt_god_schedule_test/*.c))
vpath %.c pt_completion_test
source += $(notdir $(wildcard pt_completion_test/*.c))
vpath %.c pt_event_set_test
source += $(notdir $(wildcard pt_event_set_test/*.c))
vpath %.c pt_pipe_test
source += $(notdir $(wildcard pt_pipe_test/*.c))
vpath %.c pt_ringbuf_test
source += $(notdir $(wildcard pt_ringbuf_test/*.c))
vpath %.c pt_sem_test
source += $(notdir $(wildcard pt_sem_test/*.c))
vpath %.c pt_soft_timer_thread_test
source += $(notdir $(wildcard pt_soft_timer_thread_test/*.c))
vpath %.c pt_test_mailbox
source += $(notdir $(wildcard pt_test_mailbox/*.c))
vpath %.c pt_test_msgq
source += $(notdir $(wildcard pt_test_msgq/*.c))
vpath %.c pt_workque_test
source += $(notdir $(wildcard pt_workque_test/*.c))
# zzz在后面, aaa在前面, 这样生成的地址就将其他包围住了
vpath %.c zzz_sec_fringe
source += $(notdir $(wildcard zzz_sec_fringe/*.c))
############################################
objs = $(source:%.c=$(OBJDIR)/%.o)
$(target) : $(objs)
$(CC) -o $@ $^ $(LINK_LIB) $(LFLAGS)
$(objs): $(OBJDIR)/%.o : %.c
@mkdir -p $(OBJDIR)
$(CC) -c $< $(INC) $(CFLAGS) -o $@
.PHONY : clean
clean:
ifeq ($(PLATFORM),win)
rm $(target).exe -f
rm $(OBJDIR)/*.o -f
else
find . -name "*.o" | xargs rm -f
rm $(target) -f
endif
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/xiaoyinshu/c_language_program_template.git
git@gitee.com:xiaoyinshu/c_language_program_template.git
xiaoyinshu
c_language_program_template
protothreads
master

搜索帮助