#
CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \
-Wuninitialized -Wshadow -Wundef
+DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
INSTALL= install
prefix ?= /usr/local
.c.o:
$(check) $<
- $(CC) $(CFLAGS) -c $<
+ $(CC) $(DEPFLAGS) $(CFLAGS) -c $<
all: $(progs)
-$(progs): depend
-
-depend:
- @$(CC) -MM $(ALL_CFLAGS) *.c 1> .depend
-
btrfsctl: btrfsctl.o
gcc $(CFLAGS) -o btrfsctl btrfsctl.o
gcc $(CFLAGS) -o quick-test $(objects) quick-test.o
clean :
- rm -f $(progs) cscope.out *.o .depend
+ rm -f $(progs) cscope.out *.o .*.d
install: $(progs)
$(INSTALL) -m755 -d $(DESTDIR)$(bindir)
$(INSTALL) $(progs) $(DESTDIR)$(bindir)
-ifneq ($(wildcard .depend),)
-include .depend
-endif
+-include .*.d