mirror of
https://github.com/Estom/notes.git
synced 2026-02-13 23:35:48 +08:00
26 lines
441 B
Makefile
26 lines
441 B
Makefile
CC=gcc
|
|
SRC = $(wildcard *.c */*.c)
|
|
OBJS = $(patsubst %.c, %.o, $(SRC))
|
|
DEP_FILES := $(patsubst %, .%.d,$(OBJS))
|
|
DEP_FILES := $(wildcard $(DEP_FILES))
|
|
FLAG = -g -Werror -I. -Iinclude -lpthread -luv
|
|
TARGET = targets
|
|
|
|
$(TARGET):$(OBJS)
|
|
$(CC) -o $@ $^ $(FLAG)
|
|
|
|
ifneq ($(DEP_FILES),)
|
|
include $(DEP_FILES)
|
|
endif
|
|
|
|
%.o:%.c
|
|
$(CC) -o $@ -c $(FLAG) $< -g -MD -MF .$@.d
|
|
|
|
clean:
|
|
rm -rf $(TARGET) $(OBJS)
|
|
|
|
distclean:
|
|
rm -rf $(DEP_FILES)
|
|
|
|
.PHONY:clean
|