diff --git a/Makefile b/Makefile index 28315c2..a6a2db7 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ PREFIX ?= /usr/local SRC = src/mon.c deps/ms.c deps/commander.c OBJ = $(SRC:.c=.o) -CFLAGS = -D_GNU_SOURCE -std=c99 -I deps/ +CFLAGS = -D_GNU_SOURCE -std=c99 -I deps/ -MMD mon: $(OBJ) $(CC) $(OBJ) -o $@ @@ -10,6 +10,8 @@ mon: $(OBJ) .c.o: $(CC) $< $(CFLAGS) -c -o $@ +-include $(OBJ:.o=.d) + install: mon cp -f mon $(PREFIX)/bin/mon @@ -17,6 +19,6 @@ uninstall: rm -f $(PREFIX)/bin/mon clean: - rm -f mon $(OBJ) + rm -f mon $(OBJ) $(OBJ:.o=.d) -.PHONY: clean install uninstall \ No newline at end of file +.PHONY: clean install uninstall