Automatic generation of build dependencies

This commit is contained in:
Laurent Fasnacht 2014-04-15 13:47:24 +02:00
parent 7897f7d5cd
commit 29c93d8f3f
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View file

@ -10,3 +10,4 @@
# Other files
*.exe
*.o
*.d

View file

@ -54,6 +54,8 @@ OBJS = interface_main.o encmain.o bitstream.o cabac.o config.o context.o encoder
PROG = ./kvazaar
PROGS = $(PROG)
DEPS = $(OBJS:.o=.d)
all: $(PROGS)
.PHONY: all clean
@ -66,5 +68,10 @@ cpu.o: x86/cpu.asm
%.o: %.c
$(CC) $(CCFLAGS) -c $< -o $@
%.d: %.c
$(CC) $(CCFLAGS) -MF"$@" -MG -MM -MP -MT"$@" -MT"$(<:.c=.o)" "$<"
clean:
rm -f $(OBJS) $(PROGS) $(ASMOBJS)
rm -f $(OBJS) $(PROGS) $(ASMOBJS) $(DEPS)
-include $(DEPS)