title: How to intentionally create .dep files?
body: <p>I have 5 source files (main.c, memory.c, etc) I want to generate dependency files for all of them .dep</p>
  
  <p>When I searched online I found that most people only suffer from those files created by compiler, and some are solving this by adding them forcefully to a directory. But, I want to intentionally create them to be (main.dep, memory.dep, etc)</p>
  
  <p>how can I have the make create them automatically for me by my command:</p>
  
  <pre><code>$ make build
  </code></pre>
  
  <p>I guess it will be some kind of order I will put in CPPFLAGS, then include CPPFLAGS into my $(TARGET).out recipe, but I don't know what exactly. any ideas?</p>
  
  <p>here's my Makefile right now:</p>
  
  <pre><code>include sources.mk
  
  # Platform Overrides
  
  ifeq ($(PLATFORM),MSP432)
  
  # Architectures Specific Flags
  LINKER_FILE = msp432p401r.lds
  CPU = cortex-m4
  ARCH = thumb
  SPECS = nosys.specs
  COMPILE = -DMSP432
  LDFLAGS_ARCH = -T $(LINKER_FILE)
  CFLAGS_ARCH = -mcpu=$(CPU) -m$(ARCH) --specs=$(SPECS) -march=armv7e-m 
  -mfloat-abi=hard -mfpu=fpv4-sp-d16
  OBJS = $(SOURCES:.c=.o)
  DUMP = arm-none-eabi-objdump
  
  # Compiler Flags and Defines
  CC = arm-none-eabi-gcc
  LD = arm-none-eabi-ld
  
  endif
  
  ifeq ($(PLATFORM),HOST)
  OBJS = $(SOURCES_BOTH:.c=.o)
  COMPILE = -DHOST
  CC = gcc
  DUMP = objdump
  endif
  
  
  TARGET = c1m2
  LDFLAGS = -Wl,-Map=$(TARGET).map $(LDFLAGS_ARCH)
  CFLAGS = $(CFLAGS_ARCH) $(INCLUDES)  -Wall -Werror -g -O0  -std=c99 
  $(COMPILE)
  CPPFLAGS =
  
  
  .PHONY: build
  build: $(TARGET).out
  
  .PHONY: compile-all
  compile-all: $(OBJS)
  
  CLEANO = main.o memory.o interrupts_msp432p401r_gcc.o 
  startup_msp432p401r_gcc.o system_msp432p401r.o
  CLEANI = main.i memory.i interrupts_msp432p401r_gcc.i 
  startup_msp432p401r_gcc.i system_msp432p401r.i
  CLEANASM = main.asm memory.asm interrupts_msp432p401r_gcc.asm 
  startup_msp432p401r_gcc.asm system_msp432p401r.asm
  
  .PHONY: clean
  clean:
      $(RM) $(TARGET).out $(TARGET).map $(CLEANO) $(CLEANI) $(CLEANASM)
  
  %.o : %.c
      $(CC) -c $&lt; $(CFLAGS) -o $@
  
  %.i : %.c
      $(CC) -E $&lt; $(CFLAGS) -o $@
  
  %.asm :  %.o
  $(DUMP) -S --disassemble $&lt; &gt; $@
  
  $(TARGET).out: $(OBJS)
      $(CC) $(OBJS) $(CFLAGS) $(LDFLAGS) -o $@
  </code></pre>