title: Modify Makefile to generate assembly
body: <p>I want to modify a Makefile to generate the corresponding assembly instructions. The Makefile and the code repository is located here:</p>
  
  <p><a href="https://github.com/swetland/omap4boot" rel="nofollow">https://github.com/swetland/omap4boot</a></p>
  
  <p>However, adding <code>-S</code> to <code>CFLAGS</code> primitive does not result in the desired behavior.</p>
  
  <p>What am I missing?</p>
  
  <p>Regards.</p>
  
  <p>Simplified Makefile (some lines omitted).</p>
  
  <pre><code>what_to_build:: all
  
  -include local.mk
  
  TOOLCHAIN ?= arm-eabi-
  
  BOARD ?= panda
  
  TARGET_CC := $(TOOLCHAIN)gcc
  TARGET_LD := $(TOOLCHAIN)ld
  TARGET_OBJCOPY := $(TOOLCHAIN)objcopy
  TARGET_OBJDUMP := $(TOOLCHAIN)objdump
  
  TARGET_CFLAGS := -g -S -Os  -Wall
  TARGET_CFLAGS +=  -march=-march=armv7-a+sec -fno-builtin -ffreestanding
  TARGET_CFLAGS += -I. -Iinclude
  TARGET_CFLAGS += -include config_$(BOARD).h
  
  TARGET_LIBGCC := $(shell $(TARGET_CC) $(TARGET_CFLAGS) -print-libgcc-file-name)
  
  HOST_CFLAGS := -g -S -O2 -Wall
  HOST_CFLAGS += -Itools
  
  OUT := out/$(BOARD)
  OUT_HOST_OBJ := $(OUT)/host-obj
  OUT_TARGET_OBJ := $(OUT)/target-obj
  
  ALL :=
  
  include build/rules.mk
  
  M_NAME := usbboot
  M_OBJS := tools/usbboot.o
  M_OBJS += tools/usb_linux.o
  M_OBJS += 2ndstage.o
  include build/host-executable.mk
  
  M_NAME := mkheader
  M_OBJS := tools/mkheader.o
  include build/host-executable.mk
  
  M_NAME := bin2c
  M_OBJS := tools/bin2c.o
  include build/host-executable.mk
  
  M_NAME := aboot
  M_BASE := 0x40309000
  M_OBJS := arch/omap4/start.o
  M_OBJS += arch/omap4/serial.o 
  
  
  include build/target-executable.mk
  
  $(OUT)/aboot.ift: $(OUT)/aboot.bin $(OUT)/mkheader
  @echo generate $@
  @./$(OUT)/mkheader $(TEXT_BASE) `wc -c $(OUT)/aboot.bin` &gt; $@
  @cat $(OUT)/aboot.bin &gt;&gt; $@
  ALL += $(OUT)/aboot.ift
  
  $(OUT_HOST_OBJ)/2ndstage.o: $(OUT)/aboot.bin $(OUT)/bin2c
  @echo generate $@
  $(QUIET)./$(OUT)/bin2c aboot &lt; $(OUT)/aboot.bin &gt; $(OUT)/2ndstage.c
  gcc -c -o $@ $(OUT)/2ndstage.c
  
  clean::
  @echo clean
  @rm -rf $(OUT)
  
  all:: $(ALL)`
  </code></pre>