qemu-arm/Makefile: Adjust object-file lists to get correct dependencies.
With this change both the "run" and "test" targets can be built with -j passed to make.
This commit is contained in:
parent
825460a093
commit
e5e49bedcb
|
@ -34,15 +34,15 @@ endif
|
||||||
## - gcc-arm-none-eabi-4_8-2014q1/share/gcc-arm-none-eabi/samples/src/qemu/Makefile
|
## - gcc-arm-none-eabi-4_8-2014q1/share/gcc-arm-none-eabi/samples/src/qemu/Makefile
|
||||||
LDFLAGS= --specs=nano.specs --specs=rdimon.specs -Wl,--gc-sections -Wl,-Map=$(@:.elf=.map)
|
LDFLAGS= --specs=nano.specs --specs=rdimon.specs -Wl,--gc-sections -Wl,-Map=$(@:.elf=.map)
|
||||||
|
|
||||||
SRC_C = \
|
SRC_COMMON_C = \
|
||||||
main.c \
|
|
||||||
moduos.c \
|
moduos.c \
|
||||||
modmachine.c \
|
modmachine.c \
|
||||||
|
|
||||||
|
SRC_RUN_C = \
|
||||||
|
main.c \
|
||||||
|
|
||||||
SRC_TEST_C = \
|
SRC_TEST_C = \
|
||||||
test_main.c \
|
test_main.c \
|
||||||
moduos.c \
|
|
||||||
modmachine.c \
|
|
||||||
|
|
||||||
LIB_SRC_C = $(addprefix lib/,\
|
LIB_SRC_C = $(addprefix lib/,\
|
||||||
libm/math.c \
|
libm/math.c \
|
||||||
|
@ -69,25 +69,24 @@ STM_SRC_C = $(addprefix stmhal/,\
|
||||||
pybstdio.c \
|
pybstdio.c \
|
||||||
)
|
)
|
||||||
|
|
||||||
SRC_S = \
|
OBJ_COMMON =
|
||||||
|
OBJ_COMMON += $(PY_O)
|
||||||
|
OBJ_COMMON += $(addprefix $(BUILD)/, $(SRC_COMMON_C:.c=.o))
|
||||||
|
OBJ_COMMON += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
|
||||||
|
OBJ_COMMON += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
|
||||||
|
|
||||||
OBJ =
|
OBJ_RUN =
|
||||||
OBJ += $(PY_O)
|
OBJ_RUN += $(addprefix $(BUILD)/, $(SRC_RUN_C:.c=.o))
|
||||||
OBJ += $(addprefix $(BUILD)/, $(SRC_C:.c=.o))
|
|
||||||
OBJ += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
|
|
||||||
OBJ += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
|
|
||||||
OBJ += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
|
|
||||||
|
|
||||||
OBJ_TEST =
|
OBJ_TEST =
|
||||||
OBJ_TEST += $(PY_O)
|
|
||||||
OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_TEST_C:.c=.o))
|
OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_TEST_C:.c=.o))
|
||||||
OBJ_TEST += $(addprefix $(BUILD)/, $(SRC_S:.s=.o))
|
|
||||||
OBJ_TEST += $(addprefix $(BUILD)/, $(LIB_SRC_C:.c=.o))
|
|
||||||
OBJ_TEST += $(addprefix $(BUILD)/, $(STM_SRC_C:.c=.o))
|
|
||||||
OBJ_TEST += $(BUILD)/tinytest.o
|
OBJ_TEST += $(BUILD)/tinytest.o
|
||||||
|
|
||||||
|
# All object files, needed to get dependencies correct
|
||||||
|
OBJ = $(OBJ_COMMON) $(OBJ_RUN) $(OBJ_TEST)
|
||||||
|
|
||||||
# List of sources for qstr extraction
|
# List of sources for qstr extraction
|
||||||
SRC_QSTR += $(SRC_C) $(STM_SRC_C)
|
SRC_QSTR += $(SRC_COMMON_C) $(SRC_RUN_C) $(STM_SRC_C)
|
||||||
|
|
||||||
all: run
|
all: run
|
||||||
|
|
||||||
|
@ -109,11 +108,11 @@ $(BUILD)/tinytest.o:
|
||||||
$(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c ../tools/tinytest/tinytest.c
|
$(Q)$(CC) $(CFLAGS) -DNO_FORKING -o $@ -c ../tools/tinytest/tinytest.c
|
||||||
|
|
||||||
## `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here.
|
## `$(LD)` doesn't seem to like `--specs` for some reason, but we can just use `$(CC)` here.
|
||||||
$(BUILD)/firmware.elf: $(OBJ)
|
$(BUILD)/firmware.elf: $(OBJ_COMMON) $(OBJ_RUN)
|
||||||
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
$(Q)$(SIZE) $@
|
$(Q)$(SIZE) $@
|
||||||
|
|
||||||
$(BUILD)/firmware-test.elf: $(OBJ_TEST)
|
$(BUILD)/firmware-test.elf: $(OBJ_COMMON) $(OBJ_TEST)
|
||||||
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
|
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
$(Q)$(SIZE) $@
|
$(Q)$(SIZE) $@
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue