[sw] Remove Make as a SW build system.

This change is the culmination of a month or so of work beginning, in
commit d258b33, to make all building of OpenTitan software happen
with Meson, rather than Make.

Signed-off-by: Miguel Young de la Sota <mcyoung@google.com>
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 01ef05c..3edae57 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -138,27 +138,6 @@
     parameters:
       artifact: sw_build
 
-- job: "deprecated_make_build"
-  displayName: "Build Software with Make (deprecated)"
-  dependsOn: lint
-  condition: and(succeeded(), eq(dependencies.lint.outputs['DetermineBuildType.onlyDocChanges'], '0'))
-  pool: Default
-  steps:
-  - template: 'ci/install-package-dependencies.yml'
-  - bash: |
-      export TOOLCHAIN_PATH="${TOOLCHAIN_PATH}"
-      export TOOLCHAIN_VERSION="${TOOLCHAIN_VERSION}"
-      export DIST_DIR="$(Build.ArtifactStagingDirectory)/dist"
-      REQUEST_UPDATE=true ci/run_sw_make.sh
-    displayName: 'Build embedded targets'
-  - bash: |
-      make -C sw/host/spiflash clean all
-      # TODO: build system updates needed to copy build output to a dist
-      # staging directory.
-      mkdir -p $(Build.ArtifactStagingDirectory)/dist/sw/host/spiflash
-      cp sw/host/spiflash/spiflash $(Build.ArtifactStagingDirectory)/dist/sw/host/spiflash
-    displayName: 'Build host targets'
-
 - job: "top_earlgrey_verilator"
   displayName: "Build Verilator simulation of the Earl Grey toplevel design"
   dependsOn: lint
@@ -229,6 +208,9 @@
   dependsOn:
     - top_earlgrey_verilator
     - execute_verilated_tests
+  # TODO: re-enable this CI step once RISC-V compliance correctly calls into
+  # Meson. See #1181.
+  condition: False
   steps:
   - template: 'ci/install-package-dependencies.yml'
   - template: 'ci/download-artifacts-template.yml'
diff --git a/ci/run_sw_make.sh b/ci/run_sw_make.sh
deleted file mode 100755
index c1e2a92..0000000
--- a/ci/run_sw_make.sh
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-set -e
-
-readonly DEFAULT_RISCV_TOOLS=/tools/riscv
-readonly DEFAULT_RISCV_TOOLS_VERSION=latest
-readonly DEFAULT_TOOLCHAIN_REQUEST_UPDATE=false
-readonly DEFAULT_DIST_DIR=dist
-
-TOOLCHAIN_PATH="${TOOLCHAIN_PATH:-$DEFAULT_RISCV_TOOLS}"
-TOOLCHAIN_VERSION="${TOOLCHAIN_VERSION:-$DEFAULT_RISCV_TOOLS_VERSION}"
-REQUEST_UPDATE="${REQUEST_UPDATE:-$DEFAULT_TOOLCHAIN_REQUEST_UPDATE}"
-DIST_DIR="${DIST_DIR:-$DEFAULT_DIST_DIR}"
-
-if [ ! -d "${TOOLCHAIN_PATH}/bin" ]; then
-  echo "Unable to find toolchain at: ${TOOLCHAIN_PATH}."
-  REQUEST_UPDATE=true
-fi
-
-export RV_TOOLS="${TOOLCHAIN_PATH}/bin"
-echo "Setting toolchain path to RV_TOOLS=${RV_TOOLS}"
-
-if [ "${REQUEST_UPDATE}" = true ]; then
-  echo "Syncing toolchain directory to TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}"
-  util/get-toolchain.py "--target-dir=${TOOLCHAIN_PATH}" --update --force \
-    "--release-version=${TOOLCHAIN_VERSION}"
-fi
-
-readonly BUILD_TARGETS=("boot_rom"
-  "examples/hello_usbdev"
-  "examples/hello_world"
-  "tests/aes"
-  "tests/flash_ctrl"
-  "tests/hmac"
-  "tests/rv_timer"
-)
-
-readonly BUILD_VARIANTS=("sim"
-  "fpga"
-)
-
-FAIL_TARGETS=()
-PASS_TARGETS=()
-for target in "${BUILD_TARGETS[@]}"; do
-  for variant in "${BUILD_VARIANTS[@]}"; do
-    echo "Building target ${target} (variant ${variant})"
-
-    if [ "${variant}" = "sim" ]; then
-      make_arg_sim="SIM=1"
-    else
-      make_arg_sim=""
-    fi
-
-    make -C sw/device ${make_arg_sim} "SW_DIR=${target}" \
-      "SW_BUILD_DIR=../build/${variant}/${target}"
-    if [ $? -eq 0 ]; then
-      PASS_TARGETS=("${PASS_TARGETS[@]}" "${target}-${variant}")
-    else
-      FAIL_TARGETS=("${FAIL_TARGETS[@]}" "${target}-${variant}")
-    fi
-
-    target_staging_dir="${DIST_DIR}/sw/device/${variant}/${target}"
-    mkdir -p "$target_staging_dir"
-    cp sw/build/${variant}/${target}/*.elf "${target_staging_dir}"
-    cp sw/build/${variant}/${target}/*.vmem "${target_staging_dir}"
-    cp sw/build/${variant}/${target}/*.bin "${target_staging_dir}"
-  done
-done
-
-echo "* PASS_TARGETS"
-for target in "${PASS_TARGETS[@]}"; do
-  echo "${target}"
-done
-
-if [ ${#FAIL_TARGETS[@]} -eq 0 ]; then
-  echo "BUILD PASS!"
-else
-  echo "* FAIL_TARGETS"
-  for target in "${FAIL_TARGETS[@]}"; do
-    echo "${target}"
-  done
-  echo "BUILD FAILED!"
-  exit 1
-fi
diff --git a/sw/device/Makefile b/sw/device/Makefile
deleted file mode 100644
index ba30169..0000000
--- a/sw/device/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-## NOTE: MAKEFILE IS DEPRECATED IN SW. DO NOT RELY ON THIS FILE CONTINUING TO WORK.
-
-####################################################################################################
-## Generate a baremetal application for the microcontroller                                       ##
-##                                                                                                ##
-## Documentation: doc/deprecated_make_flow.md                                                     ##
-##                                                                                                ##
-## Mandatory variables that need to be set over the command line:                                 ##
-## SW_DIR:       this is the partial directory path to the SW test being built starting from sw/  ##
-##               ex: if running hello_world.c, then SW_DIR=examples/hello_world                   ##
-##               At this location, there needs to be a 'srcs.mk' file that contains the list of   ##
-##               SW_SRCS to be built for that SW test.                                            ##
-## SW_NAME:      This is the name of the SW test begin run. Optional if SW_DIR name (last dir) is ##
-##               the same as the SW test name.                                                    ##
-## TARGET:       Target for which the sw is cross-compiled - dv|fpga|verilator|silicon, etc       ##
-##               By default, no TARGET is selected.
-##                                                                                                ##
-## Optional variables:                                                                            ##
-## SW_BUILD_DIR: This is the output location for generating all sources                           ##
-## SW_FLAGS      Global args to pass on to the compiler                                           ##
-## SW_OPTS       Global args to pass on to the sub-make commands                                  ##
-####################################################################################################
-
-
-# Generate a baremetal application for the microcontroller
-SW_ROOT_DIR   := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/..
-REPO_TOP      ?= $(realpath $(SW_ROOT_DIR)/..)
-SW_DIR        ?= examples/hello_world
-
-# SW build targets
-TARGET        ?=
-
-# sources
-STANDALONE_SW ?= 0
-include ${SW_DIR}/srcs.mk
-include exts/common/srcs.mk
-include lib/srcs.mk
-
-# common options and rules
-include opts.mk
-include rules.mk
diff --git a/sw/device/boot_rom/srcs.mk b/sw/device/boot_rom/srcs.mk
deleted file mode 100644
index f5537bd..0000000
--- a/sw/device/boot_rom/srcs.mk
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_NAME             ?= boot_rom
-SW_SRCS             += $(SW_DIR)/bootstrap.c $(SW_DIR)/boot_rom.c $(LIB_DIR)/hw_sha256.c
-INCS                += -I$(SW_ROOT_DIR)/vendor
-
-GEN_HEADER_OUTPUTS  += ${SW_BUILD_DIR}/sw/device/boot_rom/chip_info.h
-
-# overrides
-CRT_SRCS      := $(SW_DIR)/crt0.S
-LINKER_SCRIPT := $(SW_DIR)/rom_link.ld
diff --git a/sw/device/examples/hello_usbdev/srcs.mk b/sw/device/examples/hello_usbdev/srcs.mk
deleted file mode 100644
index 26811ac..0000000
--- a/sw/device/examples/hello_usbdev/srcs.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_SRCS += $(SW_DIR)/hello_usbdev.c
diff --git a/sw/device/examples/hello_world/srcs.mk b/sw/device/examples/hello_world/srcs.mk
deleted file mode 100644
index 4cf4756..0000000
--- a/sw/device/examples/hello_world/srcs.mk
+++ /dev/null
@@ -1,5 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_SRCS += $(SW_DIR)/hello_world.c
diff --git a/sw/device/exts/common/srcs.mk b/sw/device/exts/common/srcs.mk
deleted file mode 100644
index a585a52..0000000
--- a/sw/device/exts/common/srcs.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-EXT_COMMON_DIR        ?= $(SW_ROOT_DIR)/device/exts/common
-INCS                  += -I$(EXT_COMMON_DIR)
-
-EXT_COMMON_LOC_SRCS   +=
-
-EXT_SRCS              += $(addprefix $(EXT_COMMON_DIR)/, $(EXT_COMMON_LOC_SRCS))
diff --git a/sw/device/lib/srcs.mk b/sw/device/lib/srcs.mk
deleted file mode 100644
index 0d198c4..0000000
--- a/sw/device/lib/srcs.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-LIB_DIR           ?= $(SW_ROOT_DIR)/device/lib
-INCS              += -I$(LIB_DIR)
-
-GEN_HEADERS       += $(LIB_LOC_DIF_SRCS:.c=_regs.h)
-LIB_LOC_DIF_SRCS  += uart.c gpio.c spi_device.c flash_ctrl.c aes.c hmac.c usbdev.c rv_timer.c pinmux.c
-LIB_LOC_EXT_SRCS  += usb_controlep.c usb_simpleserial.c irq.c handler.c print_log.c irq_vectors.S memcpy.c memset.c strlen.c abort.c
-
-LIB_SRCS          += $(addprefix $(LIB_DIR)/, $(LIB_LOC_DIF_SRCS) $(LIB_LOC_EXT_SRCS))
diff --git a/sw/device/opts.mk b/sw/device/opts.mk
deleted file mode 100644
index ba8f2d4..0000000
--- a/sw/device/opts.mk
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-#
-####################################################################################################
-## SW build infrastructure - common opts                                                          ##
-##                                                                                                ##
-## Documentation: doc/deprecated_make_flow.md                                                     ##
-##                                                                                                ##
-## Two types of embedded SW is built typically for a test - boot_rom and sw test application.     ##
-## Each has two components - top level sources (indicated with SW_ prefix) and libraries          ##
-## (indicated with LIB_ prefix.                                                                   ##
-## If a new dir with SW or LIB sources are added, a 'srcs.mk' needs to be included and it should  ##
-## specify the additional sources either via SW_SRCS or LIB_SRCS variable, See existing examples  ##
-## for reference.                                                                                 ##
-####################################################################################################
-
-# sources and targets
-SW_NAME       ?= $(notdir $(SW_DIR))
-SW_SRCS       += $(CRT_SRCS)
-SW_OBJS       += $(addprefix $(SW_BUILD_DIR)/, $(addsuffix .o, $(basename $(notdir $(SW_SRCS)))))
-SW_DEPS       ?= lib
-SW_BUILD_DIR  ?= $(REPO_TOP)/build/sw/device/$(SW_DIR)
-
-LIB_NAME      ?= ot
-LIB_TARGET    ?= $(LIB_BUILD_DIR)/lib${LIB_NAME}.a
-LIB_SRCS      +=
-LIB_OBJS      += $(addprefix $(LIB_BUILD_DIR)/, $(addsuffix .o, $(basename $(notdir $(LIB_SRCS)))))
-LIB_BUILD_DIR ?= $(SW_BUILD_DIR)/lib
-
-DEPS          += $(SW_OBJS:%.o=%.d) $(LIB_OBJS:%.o=%.d)
-INCS          += -I$(REPO_TOP) -I$(SW_BUILD_DIR) -I$(LIB_BUILD_DIR)
-
-LINK_OPTS     += -T $(LINKER_SCRIPT)
-LINK_OPTS     += $(SW_OBJS) -L$(LIB_BUILD_DIR) -l$(LIB_NAME)
-LINK_OPTS     += -Xlinker -Map=${SW_BUILD_DIR}/${IMG_NAME}.map
-# Ensure we don't include a build-id in the elf
-LINK_OPTS     += -Wl,--build-id=none
-
-# target (either 'boot_rom' or 'sw')
-ifeq ($(SW_NAME),boot_rom)
-  IMG_NAME    ?= rom
-else
-  IMG_NAME    ?= sw
-endif
-
-IMG_OUTPUTS   += $(SW_BUILD_DIR)/$(IMG_NAME).elf \
-                 $(SW_BUILD_DIR)/$(IMG_NAME).map \
-                 $(SW_BUILD_DIR)/$(IMG_NAME).dis \
-                 $(SW_BUILD_DIR)/$(IMG_NAME).bin \
-                 $(SW_BUILD_DIR)/$(IMG_NAME).vmem
-GEN_HEADER_OUTPUTS += $(addprefix $(LIB_BUILD_DIR)/, $(GEN_HEADERS))
-
-# defaults
-CRT_SRCS      ?= $(EXT_COMMON_DIR)/_crt.c
-LINKER_SCRIPT ?= $(SW_ROOT_DIR)/device/exts/common/link.ld
-
-# tools and opts
-REGTOOL       ?= $(SW_ROOT_DIR)/../util/regtool.py
-INFOTOOL      ?= $(SW_ROOT_DIR)/../util/rom_chip_info.py
-
-RV_TOOLS      ?= /tools/riscv/bin
-# ARCH = rv32im # to disable compressed instructions
-ARCH           = rv32imc
-CC             = ${RV_TOOLS}/riscv32-unknown-elf-gcc
-CPP            = $(subst gcc,cpp,$(wordlist 1,1,$(CC)))
-AR             = $(subst gcc,ar,$(wordlist 1,1,$(CC)))
-AS             = $(subst gcc,as,$(wordlist 1,1,$(CC)))
-LD             = $(subst gcc,ld,$(wordlist 1,1,$(CC)))
-OBJCOPY        = $(subst gcc,objcopy,$(wordlist 1,1,$(CC)))
-OBJDUMP        = $(subst gcc,objdump,$(wordlist 1,1,$(CC)))
-
-CFLAGS        += -march=$(ARCH) -mabi=ilp32 -static -mcmodel=medany -Wall -g -Os \
-                 -fvisibility=hidden -nostdlib -nostartfiles $(SW_FLAGS)
-ARFLAGS        = rc
-OBJCOPY_FLAGS +=
-
-# conditional flags
-SIM ?= 0
-ifeq ($(SIM), 1)
-  CFLAGS      += -DSIMULATION
-endif
-
-ifeq ($(TARGET), dv)
-  CFLAGS      += -DDV_SIM
-endif
-
-ifeq ($(TARGET), fpga)
-  CFLAGS      += -DFPGA_SIM
-endif
diff --git a/sw/device/rules.mk b/sw/device/rules.mk
deleted file mode 100644
index e6d6e8b..0000000
--- a/sw/device/rules.mk
+++ /dev/null
@@ -1,115 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-##############################################################
-## Generic rules set for compiling SW for different targets ##
-##                                                          ##
-## Documentation: doc/deprecated_make_flow.md               ##
-##                                                          ##
-##############################################################
-
-# rules
-.SECONDEXPANSION:
-ifeq ($(STANDALONE_SW), 1)
-all: gen_dir standalone
-else
-all: gen_dir $(IMG_OUTPUTS)
-endif
-
-gen_dir:
-	mkdir -p ${SW_BUILD_DIR}
-	mkdir -p ${LIB_BUILD_DIR}
-	env > ${SW_BUILD_DIR}/env_vars
-
-standalone: $(SW_DEPS)
-	$(STANDALONE_CMD)
-
-$(LIB_TARGET): $(GEN_HEADER_OUTPUTS) $(LIB_OBJS)
-	$(AR) $(ARFLAGS) $@ $(LIB_OBJS)
-
-lib: $(LIB_TARGET)
-
-# Note: this IMG_NAME requires the srecord package to be installed.
-# XXX: This could be replaced by objcopy onc is merged.
-# https://sourceware.org/bugzilla/show_bug.cgi?id=19921
-# XXX: Currently the start address 0x1000 is hardcoded. It could/should be
-# read from the elf file, but is lost in the bin file.
-# Switching to objcopy will resolve that as well.
-%.vmem: %.bin
-	srec_cat $^ -binary -offset 0x0 -byte-swap 4 -o $@ -vmem
-
-%.bin: %.elf
-	$(OBJCOPY) -O binary $(OBJCOPY_FLAGS) $^ $@
-
-%.dis: %.elf
-	$(OBJDUMP) -SDhl $^ > $@
-
-# link & generate elf
-%.elf %.map: $(SW_DEPS) $(SW_OBJS) $(LINKER_SCRIPT)
-	$(CC) $(CFLAGS) $(LINK_OPTS) -o $@
-
-# compile sw sources
-# TOOD: figure out a way to 'templatise' .o/.c ruleset for each dir containing srcs
-
-$(SW_BUILD_DIR)/%.o: $(SW_DIR)/$$*.c
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(SW_BUILD_DIR)/%.o: $(SW_DIR)/$$*.S
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(SW_BUILD_DIR)/%.o: $(LIB_DIR)/$$*.c
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(SW_BUILD_DIR)/%.o: $(LIB_DIR)/$$*.S
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(SW_BUILD_DIR)/%.o: $(EXT_COMMON_DIR)/$$*.c
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(SW_BUILD_DIR)/%.o: $(EXT_COMMON_DIR)/$$*.S
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-# compile lib sources
-$(LIB_BUILD_DIR)/%.o: $(LIB_DIR)/$$*.c
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(LIB_BUILD_DIR)/%.o: $(LIB_DIR)/$$*.S
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(LIB_BUILD_DIR)/%.o: $(EXT_COMMON_DIR)/$$*.c
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(LIB_BUILD_DIR)/%.o: $(EXT_COMMON_DIR)/$$*.S
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(LIB_BUILD_DIR)/%.o: $(UTIL_DIR)/$$*.c
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-$(LIB_BUILD_DIR)/%.o: $(UTIL_DIR)/$$*.S
-	$(CC) $(CFLAGS) -MMD -c $(INCS) -o $@ $<
-
-# regtool
-$(LIB_BUILD_DIR)/%_regs.h: $(REPO_TOP)/hw/ip/$$*/data/$$*.hjson
-	$(REGTOOL) -D -o $@ $<
-
-$(LIB_BUILD_DIR)/%_regs.h: $(REPO_TOP)/hw/top_earlgrey/ip/$$*/data/autogen/$$*.hjson
-	$(REGTOOL) -D -o $@ $<
-
-$(LIB_BUILD_DIR)/pinmux_regs.h: $(REPO_TOP)/hw/top_earlgrey/ip/pinmux/data/autogen/pinmux.hjson
-	$(REGTOOL) -D -o $@ $<
-
-# chip_info
-$(SW_BUILD_DIR)/sw/device/boot_rom/chip_info.h: $(INFOTOOL)
-	$(INFOTOOL) -o $(dir $@) --ot_version "opentitan-<deprecated/make>"
-
--include $(DEPS)
-
-# clean sources
-clean:
-	-$(RM) -r $(GEN_HEADER_OUTPUTS) $(LIB_OBJS) $(SW_OBJS) $(DEPS) \
-	          $(IMG_OUTPUTS) $(LIB_TARGET) ${SW_BUILD_DIR}/env_vars
-
-distclean: clean
-
-.PHONY: gen_dir lib clean distclean standalone
diff --git a/sw/device/tests/aes/srcs.mk b/sw/device/tests/aes/srcs.mk
deleted file mode 100644
index 0bca6c2..0000000
--- a/sw/device/tests/aes/srcs.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_NAME       ?= aes_test
-
-# list srcs for each test
-ifeq ($(SW_NAME), aes_test)
-  SW_SRCS     += $(SW_DIR)/aes_test.c
-  SW_SRCS     += $(SW_ROOT_DIR)/lib/aes.c
-endif
diff --git a/sw/device/tests/flash_ctrl/srcs.mk b/sw/device/tests/flash_ctrl/srcs.mk
deleted file mode 100644
index c1be2b8..0000000
--- a/sw/device/tests/flash_ctrl/srcs.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_NAME       ?= flash_test
-
-# list srcs for each test
-ifeq ($(SW_NAME), flash_test)
-  SW_SRCS     += $(SW_DIR)/flash_test.c
-endif
diff --git a/sw/device/tests/hmac/srcs.mk b/sw/device/tests/hmac/srcs.mk
deleted file mode 100644
index 99f0335..0000000
--- a/sw/device/tests/hmac/srcs.mk
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_NAME       ?= sha256_test
-
-# list srcs for each test
-ifeq ($(SW_NAME), sha256_test)
-  SW_SRCS     += $(SW_DIR)/sha256_test.c
-  SW_SRCS     += $(SW_ROOT_DIR)/lib/hw_sha256.c
-endif
diff --git a/sw/device/tests/rv_timer/srcs.mk b/sw/device/tests/rv_timer/srcs.mk
deleted file mode 100644
index fb7651c..0000000
--- a/sw/device/tests/rv_timer/srcs.mk
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-SW_NAME       ?= rv_timer_test
-
-# list srcs for each test
-ifeq ($(SW_NAME), rv_timer_test)
-  SW_SRCS     += $(SW_DIR)/rv_timer_test.c
-endif
diff --git a/sw/host/spiflash/Makefile b/sw/host/spiflash/Makefile
deleted file mode 100644
index 7e47662..0000000
--- a/sw/host/spiflash/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright lowRISC contributors.
-# Licensed under the Apache License, Version 2.0, see LICENSE for details.
-# SPDX-License-Identifier: Apache-2.0
-
-PROGRAM ?= spiflash
-PROGRAM_CFLAGS = -Wall -g -Os
-
-MPSSE_DIR = ../vendor/mpsse
-MPSSE_OBJS = $(MPSSE_DIR)/mpsse.o $(MPSSE_DIR)/support.o
-
-INC += -I../../.. # i.e., $REPO_TOP.
-CFLAGS += $(INC) -std=c99
-CXXFLAGS += $(INC) -Wall -std=c++14
-LDFLAGS += -lcrypto -lftdi1 -lusb-1.0 -L/usr/lib/x86_64-linux-gnu
-DEPS  = spi_interface.h updater.h verilator_spi_interface.h ftdi_spi_interface.h
-OBJS := verilator_spi_interface.o updater.o ftdi_spi_interface.o
-
-all: $(PROGRAM)
-
-%.o: %.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-%.o: %.cc $(DEPS)
-	$(CXX) $(CXXFLAGS) -c -o $@ $<
-
-$(PROGRAM): $(PROGRAM).cc $(OBJS) $(MPSSE_OBJS)
-	$(CXX) $(CXXFLAGS) spiflash.cc -o spiflash $(DEPS) $(OBJS) $(MPSSE_OBJS) $(LDFLAGS)
-
-clean:
-	rm -f $(PROGRAM) *.o ${MPSSE_OBJS}