Fix Makefile for missing crt.o
opt.mk was using := and was not picking CRT_SRCS.
This caused the flash make to jump directly into the test instead of
crt. Since the first function in the test was an endless loop, the
test was never able to complete.
diff --git a/sw/exts/common/common.mk b/sw/exts/common/common.mk
deleted file mode 100644
index e1c70ed..0000000
--- a/sw/exts/common/common.mk
+++ /dev/null
@@ -1,52 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-#
-##########################################################################
-## The following variables must be set prior to invoking this Makefile ##
-## NAME - Top level name of the final elf ##
-## SRCS - List of files to be compiled ##
-## PROGRAM_DIR - Location of file corresponding to NAME ##
-##########################################################################
-
-all: $(LIB_DIR) $(OUTFILES)
-
-.PHONY: $(LIB_DIR)
-
-$(LIB_DIR):
- $(MAKE) -C $(LIB_DIR)
-
-$(EXE).elf: $(OBJS) $(LINKER_SCRIPT) $(LIB_DIR)
- $(CC) $(CFLAGS) $(OBJS) -T $(LINKER_SCRIPT) -o $@ $(LIBS) -Xlinker -Map=$(EXE).map
-
-%.dis: %.elf
- $(OBJDUMP) -SD $^ > $@
-
-# Note: this target requires the srecord package to be installed.
-# XXX: This could be replaced by objcopy once
-# https://sourceware.org/bugzilla/show_bug.cgi?id=19921
-# is merged.
-%.vmem: %.bin
- srec_cat $^ -binary -offset 0x0 -byte-swap 4 -o $@ -vmem
-
-%.bin: %.elf
- $(OBJCOPY) -O binary $^ $@
-
-%.o: %.c $(CHIP_INFO)
- $(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-%.o: %.S
- $(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(CHIP_INFO):
- $(RM) chip_info.h
- $(INFOTOOL) -o $(shell pwd)
-
--include $(DEPS)
-
-clean:
- $(RM) -f *.o *.d *.bin *.elf *.vmem *.map *.dis $(GENHDRS)
-
-distclean: clean
- cd $(LIB_DIR) && $(MAKE) distclean
- $(RM) -f $(OUTFILES) $(EXT_DIR)/*.o $(EXT_DIR)/*.d
diff --git a/sw/exts/common/options.mk b/sw/exts/common/options.mk
deleted file mode 100644
index 7133fec..0000000
--- a/sw/exts/common/options.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-#
-##########################################################################
-## The following variables must be set prior to invoking this Makefile ##
-## NAME - Top level name of the final elf ##
-## SRCS - List of files to be compiled ##
-## PROGRAM_DIR - Location of file corresponding to NAME ##
-##########################################################################
-
-PROGRAM_CFLAGS += -Wall -g -Os
-ifeq ($(SIM),1)
- PROGRAM_CFLAGS += -DSIMULATION
-endif
-
-EXE := $(NAME)
-SW_DIR ?= $(PROGRAM_DIR)/../..
-ROOT_DIR := $(SW_DIR)/..
-LIB_DIR := $(SW_DIR)/lib
-LIB_NAME = ot
-EXT_DIR := $(SW_DIR)/exts/common
-CRT_SRCS ?= $(EXT_DIR)/_crt.c
-EXT_SRCS ?= $(CRT_SRCS)
-EXT_ASMS ?=
-CHIP_INFO ?=
-VENDOR_DIR := $(SW_DIR)/vendor
-
-RV_TOOLS ?= /tools/riscv/bin/
-OBJCOPY ?= $(subst gcc,objcopy,$(wordlist 1,1,$(CC)))
-OBJDUMP ?= $(subst gcc,objdump,$(wordlist 1,1,$(CC)))
-
-# Use ARCH = rv32im to disable compressed instructions.
-ARCH = rv32imc
-LINKER_SCRIPT ?= $(EXT_DIR)/link.ld
-
-REGTOOL = $(ROOT_DIR)/util/regtool.py
-INFOTOOL = $(ROOT_DIR)/util/rom_chip_info.py
-
-CC := $(RV_TOOLS)/riscv32-unknown-elf-gcc
-CFLAGS ?= -Wall -g -Os -march=$(ARCH) -mabi=ilp32 -static -mcmodel=medany \
- -fvisibility=hidden -nostdlib -nostartfiles $(PROGRAM_CFLAGS)
-
-OBJS := $(SRCS:.c=.o) $(EXT_SRCS:.c=.o) $(EXT_ASMS:.S=.o)
-DEPS = $(OBJS:%.o=%.d)
-
-LIBS =-L$(LIB_DIR) -l$(LIB_NAME)
-INCS +=-I$(LIB_DIR) -I$(VENDOR_DIR)
-
-OUTFILES := $(EXE).elf $(EXE).vmem $(EXE).bin $(EXE).dis $(EXE).map
-OUTFILES += $(CHIP_INFO)
diff --git a/sw/opts.mk b/sw/opts.mk
index c3eaf0c..bcb633b 100644
--- a/sw/opts.mk
+++ b/sw/opts.mk
@@ -14,7 +14,7 @@
# sources and targets
SW_NAME ?= $(notdir $(SW_DIR))
-SW_SRCS := $(CRT_SRCS) $(SW_SRCS)
+SW_SRCS += $(CRT_SRCS)
SW_OBJS += $(addprefix $(SW_BUILD_DIR)/, $(addsuffix .o, $(basename $(notdir $(SW_SRCS)))))
SW_PPOS += $(SW_OBJS:.o=.ppo)
SW_DEPS ?= lib