DEPDIR = build_dep
TARGET_NAME = helloworld
CFLAGS = -Wall SRCS = main.c
SRCS += foo.c OBJS = $(SRCS:%.c=%.o)
all: $(OBJS)
$(CC) $(CFLAGS) $^ -o $(TARGET_NAME) debug:
@echo "CC = $(CC)"
@echo "MAKE = $(MAKE)"
@echo "SRCS = $(SRCS)"
@echo "OBJS = $(OBJS)"
@echo "CFLAGS = $(CFLAGS)" $(DEPDIR)/%.d: %.c
$(SHELL) -ec 'mkdir -p $(DEPDIR); \
$(CC) -MM $(CFLAGS) $< | sed '\''s@\($*\)\.o[ :]*@\.o $@ : @g'\'' > $@.$$$$; \
cp $@.$$$$ $@; rm $@.$$$$' include $(SRCS:%.c=$(DEPDIR)/%.d) clean:
@rm -f $(TARGET_NAME)
@rm -f *.o
04-30 04:43