我想修改一个 Makefile 来生成相应的汇编指令。Makefile 和代码存储库位于此处:
https://github.com/swetland/omap4boot
但是,添加-S
到CFLAGS
原语不会产生所需的行为。
我错过了什么?
问候。
简化的 Makefile(省略了一些行)。
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` > $@
@cat $(OUT)/aboot.bin >> $@
ALL += $(OUT)/aboot.ift
$(OUT_HOST_OBJ)/2ndstage.o: $(OUT)/aboot.bin $(OUT)/bin2c
@echo generate $@
$(QUIET)./$(OUT)/bin2c aboot < $(OUT)/aboot.bin > $(OUT)/2ndstage.c
gcc -c -o $@ $(OUT)/2ndstage.c
clean::
@echo clean
@rm -rf $(OUT)
all:: $(ALL)`